Pages Menu
TwitterRssFacebook

Posted by on Nov 2, 2011 in Development

Jquery: Which CDN (part 2)



At the end of my last post, I came to the conclusion that possibly my sample size wasn’t large enough.

I searched around for a bit for UK-specific data, but in the absence of any, I scanned Alexa’s list of top 10,000 sites.

I left the computer on last night, working through the list and compiling the results to a SQLCompact database. The results are now in!

For each site I recorded any instance of a <script> tag, with a src attribute, where the src attribute contained ‘jquery’.

Considerations

  • Firstly, a disclaimer. I’m not a statistician, so I don’t know if the way I’m presenting the data and coming to the conclusions I am are correct. I’ve included the complete data at the end, in the form of a SQLCompact database, so if you want to query the data in different ways, please do!
  • Lots of people link to files that contain the word ‘jquery’, even though they’re not the actual JQuery library. Many sites have a /jquery/ folder. I’ve done my best to filter these out, but in doing so it’s possible I’ve missed out a genuine CDN.
  • This is real data from the real internet. For reasons you may love or hate, some (a surprising amount actually) of these URLs are NSFW, 18+, Parental Supervision Required. You’ve been warned. I’ve deliberately not encoded them as links, so if you choose to visit, that’s up to you.

The Results

Who is using JQuery libraries?

Who is referencing JQuery libraries, in a way that might indicate that they are using a public CDN (denoted by using src references that start with either ‘http’ or ‘//’)

By grouping on URL, I managed to pull out some URLs that occur a lot more regularly than others. I don’t think I’ve missed any big ones.

Which means: lots of people aren’t using public CDNs for JQuery. They’re using their own CDN, or just referencing locally.

Who is using Public CDNs?

Let’s discard the private CDNs and the people that don’t want to get involved. Running the data again, showing just the CDNs I identified as occurring often yields this:

Well, that’s fairly compelling. Looks like Google CDN is still the CDN of choice.

But wait. In order to really gain value from using a CDN, you need to be using exactly the same URL as the big sites. This includes the version number – the browser just checks the cache for a URL match.

Who is using which version of jquery-min.js on Google CDN?

Lots of people are using jquery-ui-min.js, so I’ve shown the different versions for this file too:

mmmm, pretty colours.

What this is saying is that it doesn’t matter that you’ve chosen to use Google’s CDN, you have to pick the version carefully. Get too behind the curve, or too ahead, and the numbers drop off quickly.

There’s another way of looking at this last set of data, and that’s to say that it’s not just the number of sites using a particular version that’s important, but their traffic ranking. 1 site in the top 10 beats 100 sites in the bottom 1000. So, here’s that data again, showing both the number of instances and the rank of the highest ranked site. I was going to leave it at that, but I’ve also included the URL of the highest ranked site. This will allow you to make a subjective, emotive and statistically invalid decision based on the content of the site (demonstrated very well by the first two rows!)

 

As I said before, I’m not a statistician, so please do download this data (link now removed, contact me for details) and try this out for yourself. Let me know if you come to different conclusions. (note that in the download database, the table structure makes it look like it’s just UK sites, not worldwide ones. That’s just left over from the last experiment).

Written by Tom Morgan

Tom is a Microsoft Teams Platform developer and Microsoft MVP who has been blogging for over a decade. Find out more.
Buy the book: Building and Developing Apps & Bots for Microsoft Teams. Now available to purchase online with free updates.

Post a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.