If a user visits several sites that reference jQuery (or another library) from Google, their browser caches the file and will only load it once, reusing the cached file on the other sites when they are loaded. This is because you’re referencing a file from ajax.googleapis.com instead of your own domain, and if multiple sites reference it, the browser remembers it already downloaded the file and uses the local copy.
The libraries available at the present are:
- jQuery UI
- Yahoo UI Library
Simple, and a good way to cut down on page load time. The only downside is, if Google were to have problems with the servers that host the scripts, we would be looking at a web-wide lack of scripts that may be critical to the operation of some sites. Google is known to be fairly reliable, but you never know, it’s always possible that the supposedly impossible could happen. Then we would have a problem like the Amazon S3 outage last year, where scores of sites were affected. (Twitter’s avatars went AWOL, SmugMug had photos not showing, some podcasts weren’t downloadable, etc..)