Why Use CDN Hosted jQuery?
Posted by in jQueryWhy should you even consider using CDN hosted jQuery? Well, one answer is that lots of big sites already do it. Just a sampling: Break.com, FAIL Blog, Foursquare, Twitter, Posterous, SitePoint, Stack Overflow, Stanford.edu, and the jQuery site itself. If it’s good enough for them, there’s a decent chance that CDN hosted jQuery will work for you, too.
But if you need a little more convincing than that, Dave Ward does a nice job explaining the advantages:
Decreased Latency
A CDN — short for Content Delivery Network — distributes your static content across servers in various, diverse physical locations. When a user’s browser resolves the URL for these files, their download will automatically target the closest available server in the network…
Increased parallelism
To avoid needlessly overloading servers, browsers limit the number of connections that can be made simultaneously. Depending on which browser, this limit may be as low as two connections per hostname. Using the Google AJAX Libraries CDN eliminates one request to your site, allowing more of your local content to downloaded in parallel.
Better caching
Potentially the greatest (yet least mentioned) benefit of using the Google AJAX Libraries CDN is that your users may not need to download jQuery at all. No matter how aggressive your caching, if you’re hosting jQuery locally then your users must download it at least once. […] When a browser sees multiple subsequent requests for the same Google hosted version of jQuery, it understands that these requests are for the same file. Not only will Google’s servers return a 304 “Not Modified” response if the file is requested again, but also instructs the browser to cache the file for up to one year. This means that even if someone visits hundreds of sites using the same Google hosted version of jQuery, they will only have to download it once.
Learn how to use hosted jQuery from the following CDN’s:
