6 ms·
Note that this means that there's no longer a pressing need to consolidate multiple javascript files into one file, likewise with CSS files. Icon sprites aren'
by jewel 12y ago
Note that this means that there's no longer a pressing need to consolidate multiple javascript files into one file, likewise with CSS files. Icon sprites aren't necessary either.
There are still some gains from combining the files, as it will mean less headers will go over the wire, and you'd still want to minify them so that there were less total bits, but the gains aren't going to be as big as they used to be.
- nickspacek 12y agoSimilarly to GZIP applied by the Web Server, you could build your minification in, although given that the approaches are more varied and less standard it might not be the greatest idea.
- cbr 12y agoIt sounds like you're describing PageSpeed: https://developers.google.com/speed/pagespeed/module https://developers.google.com/speed/pagespeed/module
- Kudos 12y agoThis is one of the more exciting parts for me. At Udemy ~90% of our visitors have SPDY3 or better (tech-savvy audience). Our JS needs an overhaul and the timing is great for a rethink on how we deliver it. We're looking at optimising for those users and no longer bundling our JS and CSS. We need to test it further because we can't simply flick a switch and flick it back if it doesn't work out, we'll need to move away from Fastly to somewhere that has SPDY first.
- mohamedattahri 12y agoIt's a good thing that all headers are now compressed and many are only sent once. So I'm not sure more headers is what could hurt. I'm curious as to how javascript engines perform with one hundred files multiplexed VS one giant file.
- andrewstuart2 12y agoI personally still think that JS should still always be pre-processed. When you can spend longer up front optimizing the concatenation, minification, and compression, you can amortize that additional cost across every request and still make important incremental gains. A bit saved is a bit earned.
- Kudos 12y agoYou can and should still compress and do some amount of minification. Concatenation is debatable on sites with varied page types and JS needs. > A bit saved is a bit earned. So don't send bits the user probably won't need? :P
- Twirrim 12y ago> So don't send bits the user probably won't need? :P Surely good for both your bandwidth bills, and the end user experience. The less work your users have to do, the better, especially when it comes to mobile devices.
- swang 12y agoMost sites right now concatenate their _entire_ javascript blob rather than the "necessary" javascript blob for the current page. There are arguably other uses for minification and compression, but not needing to concatenate is going to save a lot of bandwidth since developers no longer have to consider whether or not they need to build another concatenated blob for specific pages.
- ZeroGravitas 12y agoThere's not many benefits remaining to combining files. I'm sure the new best practice will get worked out in detail but e.g. you can update one js/css/image file but regular users will still have all the rest in their cache, people who only ever use one part of your site may never need to load some js/CSS/image files at all (reducing both load and parse time as well as memory), files you know you'll need can be prioritized or pre-cached rather than combined like we used to do for image rollover effects.
- r1ch 12y agoUnfortunately most spdy / HTTP2 implementations mandate TLS. This means websites that rely on ad revenue cannot benefit from these improvements without losing revenue. I'd really love to use spdy / HTTP2 but ad revenue is more important, so I'll be continuing to sprite for the near future. Given how awful ad serving architecture is these days for smaller publishers (chains of javascripts and iframes), I don't anticipate this being fixed for quite a while.