3 ms·
Discussion of the issue here (disclaimer, I started the pull request) - https://github.com/h5bp/html5-boilerplate/pull/1327 https://github.com/h5bp/html5-boiler
by LocalPCGuy 13y ago
Discussion of the issue here (disclaimer, I started the pull request) - https://github.com/h5bp/html5-boilerplate/pull/1327 https://github.com/h5bp/html5-boilerplate/pull/1327
The basic gist is that there is great fragmentation in the cache eco-system, and so there is no guarantee that the user actually has the version of jQuery cached that you are requesting. Alex Sexton brought up in a talk at jQueryTO that there are also the time for the DNS request itself to consider in any discussion of speed, if you concatenate/minify your code it will eliminate a DNS request.
Resources discussed in that page:
http://statichtml.com/2011/google-ajax-libraries-caching.html http://statichtml.com/2011/google-ajax-libraries-caching.htm...
http://www.stevesouders.com/blog/2011/08/17/http-archive-nine-months/ http://www.stevesouders.com/blog/2011/08/17/http-archive-nin...
http://www.stevesouders.com/blog/2013/03/18/http-archive-jquery/ http://www.stevesouders.com/blog/2013/03/18/http-archive-jqu...
The end conclusion was that for H5BP it didn't make sense to remove the CDN reference, but for your own site it might - you should test it and see. It also depends on your audience (will the CDN move the files closer geographically?).
In the end, ~40k (gzipped) is not going to make or break your website's performance.
- glitchdout 13y agoI disagree with your assessment (and so does the majority of people on that pull request, it seems). It's always better to use a CDN because: 1. It has a chance to be already cached (specially if you use Google's CDN). 2. All browsers nowadays do 6 parallel requests per host. So using DNS prefetching with `rel=dns-prefetch` will be faster. 3. If you bundle jQuery with your site's JS files, every time you change a single JS file of your own, your users will be forced to re-download your bundled jQuery. Seems pretty inefficient to me.
- youngtaff 13y agoIf you're using HTTPS then "it's always better to use a CDN" is unlikely to be true due to the costs of negotiating the secure connection. 1. Is open to debate and we have no real numbers of this - hopefully the resource timing API will all us to shed some light on the issue 2. Not sure how the number of connections is relevant as the connection to the CDN will be a new one. 3. Agree with this, people need to merge files that naturally fit together an have similar patterns of change
- LocalPCGuy 13y agoIt wasn't MY assessment, I just posted the assessment of other s to start the conversation. I don't think you should never use a CDN, there are quite valid reasons to do so. But people shouldn't go around saying that is the only way to go either. It should depend on your site, and the testing you do on that site.