Hacker News new | ask | show | jobs
by spjwebster 4478 days ago
I did some research on this a few years ago [1], and Steve Souders recently re-ran the test with the latest http archive data [2]. Given the percentages, I'm still not convinced that it makes sense to reference jQuery or any other library from a shared CDN.

That said, you also need to be careful with concatenation. It's tempting to go for a 'concatenate everything into one file' approach, but that can be suboptimal. When you've got a large library like jQuery that changes infrequently, concatenating that with your constantly-evolving application code results in your users paying the download cost for jQuery every time you make a change (albeit without the connection overhead). Instead, it make sense for some applications to bundle third party libraries into one file, and the application code into another.

As I said in my original article, the most important thing you can do to improve the performance of your site is to measure client-side performance from your real user traffic, establish a baseline and only then try various techniques and see which ones have the greatest impact for your site and your visitors. There are various techniques that /might/ help, and some are more universal than others, but you won't know for sure if a change helped or hindered if you can't look at your stats.

[1] http://statichtml.com/2011/google-ajax-libraries-caching.htm... [2] http://www.stevesouders.com/blog/2013/03/18/http-archive-jqu...

1 comments

Thanks a lot for your data and citations!