JavaScript CDNs: for effective caching be specific about the version you want

16 April 2011

If you use Google’s CDN, if at all possible, you really want to be spe­cific about the version of the library you want. Otherwise, if you say you want 1.7.x, the library will need to be sent to the browser with in­struc­tions to check back every so often to see if a newer release in the 1.7 series is available, which in Google’s case is just 1 hour. On the other hand, if you are able to specify that you want Pro­to­type 1.7.0.0—no more and no less—then the browser is able to cache the library for 1 year.