I was double checking the URL for the CDN version of jQuery this morning, and noticed that there are three different locations now.

Is having multiple networks hosting a product bad, or even self-defeating? I thought a primary advantage is that as more and more sites use a CDN version, that the odds the library being cached in the browser keep going up. If the CDN is set up properly, and a user is using a decent browser, then the network doesn't even get accessed for a cached file. In the case with jQuery, does't having having three CDNs lower the cache hit rate by 1/3?

Am I missing something here?

  • Mods, I wasn't totally sure which SO site this was most appropriate for. Since the question is more conceptual, I thought here, rather than the main SO site, was best. Move if you feel otherwise. – mpdonadio Nov 7 '11 at 17:00
  • webmasters.stackexchange.com looks more appropriate for this subject matter. – Oded Nov 7 '11 at 17:01
  • 4
    @Oded I disagree. Using a CDN for a common library is a relevant choice to application developers. A webmaster is unlikely to manage the code. – Jeremy Nov 7 '11 at 17:09

One of the primary purposes of a CDN is to distribute files globally and to serve clients from a location closest to them. This also provides redundancy. Cache hits across applications is not a primary purpose for an application using a CDN, although it is a side benefit for common libraries such as jQuery.

  • Not disagreeing with you, but in the context of a 31k JS file, does the network nearness make a measurable difference? It seems to me that the side-effect for this case turns into the primary benefit. Also, if redundancy is an advantage, should we be extending the local fallback technique(s) to use the other CDNs first before our local version? – mpdonadio Nov 7 '11 at 19:18
  • 1
    There is bandwidth and latency. For small libraries like this, nearness is just as important as it is latency that is the biggest factor. When I was in Australia, this (network nearness) could make as much as a 1/2 second difference for a single resource. – Dan McGrath Nov 7 '11 at 19:25
  • Thanks @Dan McGrath. I didn't know that RTT for a single resource could be that bad. – mpdonadio Nov 7 '11 at 21:02

The fact that it is hosted by the 3 biggest players in the game means the library will be available and supported, I'm more comfortable having options and public shows of support and some extra cache misses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.