I’ve seen this a few times over the past few months:
What that basically says to Google is “give me the latest 1.* branch version of jQuery and make sure it’s minified.”
Minified is good. Using the Google CDN is good. One thing that’s not so good is the fact that the above file is set with the following headers:
Date: Wed, 23 Jun 2010 18:26:27 GMT Expires: Thu, 17 Jun 2010 14:26:58 GMT Age: 2045 Server: GFE/2.0
Notice anything about the expires headers? Yeah, it’s actually set in the past. That’s uncacheable. That makes sense as the purpose of that link is to get the freshest version so you don’t want the browser to hold onto an old version. Thing is, when you’re building a site you want the browser to hold onto a file like that, since it’s the site equivalent of plumbing.
So, instead of using the generic “latest” link format, pin it down to a specific version number
Here are those headers:
That files expires 1 year from access. That’s what you want.
All of this is ignoring the very real possibility that published code could break as the underlying APIs change. It’s rare over the short term, but if a site live for more than a couple of years the odds are going good something will break because of an update that deprecates or changes some functionality.