News for hackers. Stuff that matters.
Re:Top Mistakes of Massive CSS by pan69 on Saturday July 03, 2010 @10:35PM (#1484986)
Aren't most of these 'rules' applicable to just about everything you serve from your domain, not just CSS?
Re:Top Mistakes of Massive CSS by wyuenho on Sunday July 04, 2010 @01:35AM (#1485228)
Yes but everything else except the document is supposedly optional and tend to scale up rather quickly. So these rules have a little more weight when applied to your CSSes and JSes.
Re:Top Mistakes of Massive CSS by stan_rogers on Sunday July 04, 2010 @08:55AM (#1485599)
One small question: why wasn't the link to the original posting at Stubbornella rather than to a reblog? Did I miss the meeting where we decided there were no girls allowed?
Re:Top Mistakes of Massive CSS by pistoriusp on Sunday July 04, 2010 @04:37AM (#1485385)
If you're serving your css / javascript gzipped is there any additional value to minifying it?
Re:Top Mistakes of Massive CSS by nex3 on Sunday July 04, 2010 @05:29AM (#1485428)
Yes. While combining minification and gzip doesn't produce as dramatic an improvement as either does above plain text, combining them does usually yield some additional improvement (especially if minification handles things like variable renaming in JS or property folding in CSS).
Re:Top Mistakes of Massive CSS by pierrefar on Sunday July 04, 2010 @08:56AM (#1485601)
From experimentation using various "typical size" CSS, you can get a few more kb, which works out to about 3-7% extra savings for these file sizes.

Definitely worth it, particularly for high traffic sites.

Re:Top Mistakes of Massive CSS by wyuenho on Sunday July 04, 2010 @01:33AM (#1485226)
56% Serving CSS with Cookies? Wow. I must have missed this wave of innovation. I honestly have never heard of this before.
Re:Top Mistakes of Massive CSS by pistoriusp on Sunday July 04, 2010 @04:34AM (#1485381)
If you're serving static media on a domain that also serves cookies then each request to the static media will include the cookie request.

Generally you can serve cookies on www.example.com and not have request to example.com include cookies.

Re:Top Mistakes of Massive CSS by wyuenho on Sunday July 04, 2010 @04:45AM (#1485395)
Right, but how is this a problem that you can control? It's the client that sends back the cookies, not the server, and you can't control your clients. When you need to set a cookie, you just do.

I think this number needs some sort of clarifications from Steve Souders as to what he means.

Re:Top Mistakes of Massive CSS by jasonkester on Sunday July 04, 2010 @05:11AM (#1485422)
Yes, this is a problem you can (and should) control.

It's as simple as registering mysitecdn.com (assuming your main domain is mysite.com) and serving all static content from there. Never set cookies against your CDN domain and they will never be in your users browser, thus ensuring he won't send them back to you with every request.

Re:Top Mistakes of Massive CSS by wyuenho on Sunday July 04, 2010 @05:53AM (#1485452)
Ah ha this makes more sense. So if I don't want to use a real CDN, I can just set my cookies with a domain www.mysite.com, serve all my static content from cdn.mysite.com and I'm all set?
Re:Top Mistakes of Massive CSS by pistoriusp on Sunday July 04, 2010 @06:11AM (#1485467)
100% correct.

Just some clarification for those that don't get it. Setting cookies on mysite.com; means that the cookies will be pushed by the client for all subdomains for mysite.com (*.mysite.com);

-- But if you're setting cookies from www.mysite.com you can serve media from cdn.mysite.com and the requests from cdn.mysite.com will not push cookies to your server.

Re:Top Mistakes of Massive CSS by istjohn on Sunday July 04, 2010 @03:25AM (#1485313)
Cookies are usually served by default with any http communication, including serving CSS files.
Re:Top Mistakes of Massive CSS by wyuenho on Sunday July 04, 2010 @04:42AM (#1485392)
Well no. I think you must have confused HTTP headers with Cookies. Cookies are "set" by the server, usually only once per value, and then "sent" back from the client on every request. Cookies are an extension of HTTP, it's not served, whether by the client or the server, on any HTTP communication. It's only sent back by the client when it needs to tell the server it is maintaining a certain state. In the case of CSS, there's no state to maintain, so Cookies are certainly supposedly useless. For details, I refer you to RFC 2965.

I'm not sure what exactly what Steve Souders means when he wrote "serve CSS with Cookies". It sounds like 56% of the population piggyback CSS in the Cookie values...