by glitchdout · 13y ago · 0 comments
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.
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