3 ms·
When using this CDN for versioned libraries like jQuery, be sure to avoid using the "latest version" references[1][2]. In order for the "latest version" featur
by Encosia 16y ago
When using this CDN for versioned libraries like jQuery, be sure to avoid using the "latest version" references[1][2].
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.
When you reference the full version explicitly[3], it's served with a +1 year expires header.
// Not cached for long.
[1] http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
[2] http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.j...
// Cached for up to a year.
[3] http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min...
- qeorge 16y agoGood point. Another reason to do this is that jQuery and other libraries are not always backwards compatible between point releases, so you can end up with broken code in the wild without your knowledge.