You can use a CDN and fallback to local if it goes down.
http://stackoverflow.com/questions/5257923/how-to-load-local...
Re:JQuery 2.0 Released
by crazygringo on Friday April 19, 2013 @11:12AM
(#5577043)
I would be wary of that -- I assume it's likely that a CDN would often time out in case of error, which means you might be looking at 30 or 60 seconds until JavaScript works on your page.
Re:JQuery 2.0 Released
by darkandbrooding on Friday April 19, 2013 @12:44AM
(#5574876)
Y'know, I hadn't even considered that your browser might already have a cached copy of JQuery because of a previous visit to some other site. Like the friend you mentioned, the idea of third-party hosting for a critical piece of infrastructure is a non-starter for me. If my site depends on X, I prefer (the illusion of) control over X.
The main advantage to using a CDN is that a single copy can be cached across multiple websites, meaning that the first time someone visits your site, there's a good chance your version of jQuery already sits on their computer. Plus, the Google CDN will often serve content faster than your own site. And, since jQuery is now so "integral" to websites, it almost seems silly to have to maintain a copy of it yourself.
But the main downside to using a CDN is that, CDN's have gone down before, and that means your site will stop working. Obviously, it doesn't happen often, but it happened once to a widely used site of a friend of mine, and he swore, never again will he reference jQuery on a CDN. I personally prefer to host myself too. (But not out of bandwidth savings, that just winds up being trivial.)