Pingdom Home

US + international: +1-212-796-6890

SE + international: +46-21-480-0920

Business hours 3 am-11:30 am EST (Mon-Fri).

Do you know if your website is up right now? We do! LEARN MORE

CDN performance: Downloading jQuery from Google, Microsoft, and Edgecast CDNs

jQueryIf you’re using jQuery, a good thing you can do is to use the jQuery file hosted on one of the three public content delivery networks (CDNs) provided by Google, Microsoft and Edgecast (via MediaTemple).

This has several benefits:

  • You offload your own servers.
  • You increase the odds that the file is cached, since other sites will be linking to the same file.
  • A CDN will probably deliver the file faster than you can.

So which of these free CDN options will give you the best performance?

CDN performance

These are the average results of the two-week period leading up to today, with monitoring done from multiple locations spread over Europe and North America, and tests done every minute (the test was to download the minified jQuery Javascript file, the one sites would be including). The monitoring was done by Pingdom (that’s us).

jQuery script download performance from Google, Microsoft and Edgecast CDNs

A few observations on performance:

  • Google’s CDN is consistently the slowest of the three both in North America and Europe.
  • In Europe, Microsoft’s CDN is the fastest.
  • In North America, Edgecast’s CDN is the fastest.
  • Edgecast’s CDN wins in terms of average performance.

Getting actual numbers can always be a bit surprising, and we have to admit that we are a bit surprised to see that Google lagged behind so much here.

Other factors to consider

When someone visits your site, if they have already visited another site that uses the same jQuery file on the same CDN, the file will have been cached and doesn’t need to be downloaded at all. It can’t get any faster than that.

This means that the most widely used CDN will have the odds on its side, which can pay off for your site. Unfortunately, we don’t have any data on which of these CDNs is actually the most widely used.

There is also reliability to consider, although two weeks of monitoring is not enough to draw any long-reaching conclusions about this. We will get back to you on this further down the line when the monitoring has been running for a longer period of time.



10 comments
Webstandard-Blog
Webstandard-Blog

Really good idea, especially the JavaScript-Framework jQuery is growing and growing. Thx for the comparison beteween thos 3 opportunities!

Michael
Michael

Dave - will be interested to see your results, because the Pingdom results above don't back your confidence in the Google net. Quite the opposite: they fared the worst in all tests and all regions. (Which also makes me wonder WHY so many top sites use it, but that's another story.) And are you absolutely sure about MSN cookies? That doesn't make much sense to me, but I'll need to think and research that more. Richy: based on my testing experience for clients, I have found that Amazon is almost always the slowest. Akamai, EdgeCast and Limelight are the fastest. Although, Akamai is a beast to work with (on the business side) and their pricing/commitments are very high. Also, Amazon seems content going after the bottom of the market - low prices, no commit, etc. - and don't seem interested in offering the features and services that would attract the big guys. And that's just fine, there's probably a ton of money to be made there. But it's not going to attract the top sites.

Dominik Deobald
Dominik Deobald

Quite interesing to note: jQuery 1.4.2 is about 6kb smaller on Google than it is on Microsoft.

cancel bubble
cancel bubble

I was just going to reference the zoompf.com blog article - it's a very interesting read.

Dave Ward
Dave Ward

Another issue with the Microsoft CDN is that microsoft.com isn't a cookieless domain. If you're referencing that CDN on your site and your user has microsoft.com cookies, that CDN request is needlessly burdened with them. Ultimately, it's tough to beat the Google CDN due to its ubiquity. Using any other CDN, you're wagering that your users haven't recently been to another site using the Google CDN (since that results in your jQuery reference being sourced instantly from the user's cache). I recently analyzed the sites in Alexa's top 200,000 and found that thousands of those are using the Google CDN. So, I think that betting against users having Google's copy cached is a bad bet. I'll be posting more detailed information about what I found in that Alexa top 200k analysis on my blog in the next couple weeks, if anyone's interested.

Billy Hoffman
Billy Hoffman

We did some research back in January about how prevalent different CDNs are that offer free hosting of common JavaScript libraries. The full post is here, but the short story is due to the lack of critical mass, using a JavaScript library CDN actually hurts performances, it doesn't help performance. Our full research is here: http://zoompf.com/blog/2010/01/should-you-use-javascript-library-cdns

Maykel Rodriguez
Maykel Rodriguez

Hi Richy, I would be interested in compiling some Internap CDN stats, would you mind emailing me at maykelrr at speedyrails dot com? Thanks!

Maykel Rodriguez
Maykel Rodriguez

Hi guys, what a coincidence, I had twitted (@speedyrails) about our tests between EdgeCast CDN and CloudFront earlier today (http://www.speedyrails.com/cdn/howfast) and these results are great! I'm going to include a link to this post in our site.

Richy C
Richy C

We have the majority of our "static files" on the Internap CDN - and jQuery is one of those files. Let me know if you would be interested in compiling stats against it for inclusion. It'll be nice for a comparison against most "business CDNs" such as Internap, Amazon Cloudfront, Limelight, Cachefly and Rackspace Cloud.