4 ms·
There's no excuse for a blog to have 4 external stylesheets: these can easily be concatenated. Worse yet, they're not even minified.
by bkrausz 16y ago
There's no excuse for a blog to have 4 external stylesheets: these can easily be concatenated. Worse yet, they're not even minified.
- dmpatierno 16y agoYou're right about them not being minified, but wrong about the need for 4 external stylesheets. Look at their home page, for example. It uses just one stylesheet (v6core.css). That same file is also used on their blog, so my browser already has it cached. Perfect! None of those stylesheets are less than 45K, so the savings they get from not needing to download them on every page outweighs the HTTP request hit they take by including them separately on more complex pages.
- jluxenberg 16y agoEven if the CSS is cached, your browser still needs to ask the server if the files has changed and receive back a "304 Not Modified," so you're still incurring the overhead of those connections.
- dmpatierno 16y agoNot if you set a proper far-future Expires header.
- kemayo 16y agoThere's no excuse for a dedicated blog to have 4 stylesheets, sure. But this is a subpage of a big website. The stylesheets are based on logical separation, with more sheets getting added in as you go to more specialized pages. On the frontpage, which is really more of our focus, there's a single CSS file. CSS doesn't get anywhere near as much benefit from being minified as JS does. There's much less scope for transformation of the code to make it smaller, so if you're serving your CSS gzipped (which we do) then the difference is minimal at best.
- bkrausz 16y agoGood point on the redownloading part: I'd have to look into the actual numbers, if the homepage-primed connection count is still only 1 it's definitely worth it. However, I disagree about the low benefit of minifying gzipped CSS. I thought the same thing too until I ran some tests. For example: 34K v6core.css.gz 27K v6core.min.css.gz I ran your core CSS file through YUI compressor and then gzip. 7k of savings, over 20%, definitely seems worth it.
- kemayo 16y agoInteresting; that's a lot more than I had expected. It's only a few lines of code to change to make it happen, so we may well do it. (Need to do some quick checking to make sure that we don't have any old CSS hacks in there that might play poorly with being minified.)