This may be obvious to some, but I've been wondering: why should I depend on Google's server to host jQuery for my site?
Is it only because it loads faster this way?
This may be obvious to some, but I've been wondering: why should I depend on Google's server to host jQuery for my site?
Is it only because it loads faster this way?
This is because:
There are a couple scenarios when you might not want to use jQuery from Google's CDN:
When you are building an intranet application where the webserver is hosted on the same network as the clients. If you use Google's CDN jQuery, you will be making a call to the internet rather than a webserver on the local network. This increases bandwidth for your organization, and is slower.
When you are server pages over SSL that require jQuery. You should server the javascript over SSL as well as your page to avoid security problems and warnings.
Also, Microsoft hosts jQuery on their CDN. That is another choice comparable to using Google's hosted jQuery.