When using this CDN for versioned libraries like jQuery, be sure to avoid using the "latest version" references[1][2].<p>In order for the "latest version" feature to be reliable, they have to avoid users having stale local copies for very long. Thus, they serve those with a much closer expires header, which defeats one of the shared CDN's biggest benefits.<p>When you reference the full version explicitly[3], it's served with a +1 year expires header.<p>// Not cached for long.<p>[1] <a href="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js</a><p>[2] <a href="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.j...</a><p>// Cached for up to a year.<p>[3] <a href="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min...</a>
While the advantage of referencing the google api files is that your browser can take advantage of cached copies, Google Webmaster Tools recommends reducing the number of DNS lookups if you do so. I recently worked through all the PageSpeed and YSlow flags and saw a decent bump in traffic afterward. It could be coincidence, but I had a long history of stable traffic, so the timing seemed too coincidental.
I find this page more convenient: <a href="http://code.google.com/apis/ajaxlibs/documentation/index.html" rel="nofollow">http://code.google.com/apis/ajaxlibs/documentation/index.htm...</a>