Make Your Site Faster – Cloudflare’s CDNJS vs. Google Hosted Libraries – SHOCKING Results

I have used Google Hosted Libraries for as long as I can remember, and it’s what we use on Category5.TV to accelerate the javascript end of our site.  For all the javascript and CSS (plus images and so-on) we use that aren’t available through Google’s hosted solution, I use Amazon S3 and distribute it through Cloudflare to make it load quickly for our viewers.

I’ve been fast falling in love with Cloudflare’s CDNJS.

CDNJS boasts that it is in fact much faster than Google Hosted Libraries.

Neah… that can’t be true!  Google’s the “big dog”… Cloudflare is still relatively new.

RELATED VIDEO

So I took a look.  The first thing that shocked me was the absolute magnitude of how many javascript tools are available through CDNJS.  Gone is the need to (for example) load jQuery from Google Hosted Libraries but then have to download and deploy a copy of Fancybox 2 locally or on your own CDN.  CDNJS seems to have it all.  Or at least a great selection, plus the ability to add a library yourself via GitHub.

Sorry, what?  Yeah, baby.

So I thought, let’s run the world’s simplest test: how fast does wget receive the jQuery library on Linux?  It may not be a realistic benchmark in all cases, but it gives us a bit of a look at how quickly each service delivers the js.

Here are those simple (but amazing) results from my location in Ontario, Canada:

Google Hosted Libaries
robbie@robbie-debian:/tmp$ wget http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
–2013-03-22 13:50:47–  http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
Resolving ajax.googleapis.com… 74.125.133.95, 2607:f8b0:4001:c02::5f
Connecting to ajax.googleapis.com|74.125.133.95|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: unspecified [text/javascript]
Saving to: `jquery.min.js.1′ [ <=> ] 92,629      –.-K/s   in 0.1s

2013-03-22 13:50:47 (798 KB/s) – `jquery.min.js.1′ saved [92629]

CDNJS
robbie@robbie-debian:/tmp$ wget http://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js
–2013-03-22 13:49:57–  http://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js
Resolving cdnjs.cloudflare.com… 141.101.123.8, 190.93.243.8, 190.93.242.8, …
Connecting to cdnjs.cloudflare.com|141.101.123.8|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: unspecified [application/x-javascript]
Saving to: `jquery.min.js’ [ <=> ]  92,629      –.-K/s   in 0.04s

2013-03-22 13:49:58 (2.21 MB/s) – `jquery.min.js’ saved [92629]

Note the filesize (92,629) is exactly the same; we’re dealing with the same version of jQuery here–identical files.  Also note that I’ve used a non-secure (http) connection for each.  The difference in speed is incredible.

Now, for a basic site, the fraction-of-a-second difference may not matter to you.  But for a big site like mine, this kind of difference could mean a full second off the load time–possibly more!  That’s unheard of for a simple copy-and-paste change in code.

Time to update Category5.TV.  What about your site?  Please comment below.

Update:  Garbee made a great point in our IRC room:  You’re only seeing results from my location.  Fair enough.  We want to make sure this isn’t just me that is experiencing such a massive difference.  Therefore, please run this exact test yourself, and post your results below in a comment.  I’m in Ontario, Canada.  Where are you?  Thanks!

First Day Results Extracted from Reader Comments:

  • Me:
    Ontario Canada – Google @ 798 KB/s, CDNJS @ 2.21 MB/s, CDNJS is 2.77x the speed of Google.
    Brea California – Google @ 2.27 MB/s, CDNJS @ 14.5 MB/s, CDNJS is 6.39x the speed of Google.
  • Garbee:
    Virginia USA – Google @ 429 KB/s, CDNJS @ 496 KB/s, CDNJS is 1.16x the speed of Google.
    New Jersey USA – Google @ 104 KB/s, CDNJS @ 2.60 MB/s, CDNJS is 25x the speed of Google.
  • Chris Neves:
    Montana USA – Google @ 123 KB/s, CDNJS @ 300 KB/s, CDNJS is 2.44x the speed of Google.
  • Alan Pope:
    Farnborough UK – Google @ 1.26 MB/s, CDNJS @ 1.16 MB/s, Google is 1.08x the speed of CDNJS.
    London England – Google @ 6.79 MB/s, CDNJS @ 4.72 MB/s, Google is 1.44x the speed of CDNJS.
  • steve5:
    Leeds UK – Google @ 153 KB/s, CDNJS @ 178 KB/s, CDNJS is 1.16x the speed of Google.
  • Bryce:
    Seattle Washington – Google @ 1.83 MB/s, CDNJS @ 659 KB/s, Google is 2.78x the speed of CDNJS.
  • Calvin:
    Massachusetts USA
    Test 1: Unsecure Connection
    – Google @ 810 KB/s, CDNJS @ 876 KB/s, CDNJS is 1.08x the speed of Google.
    Test 2: Secure Connection – Google @ 721 KB/s, CDNJS @ 1.08 MB/s, CDNJS is 1.5x the speed of Google.

CDNJS

LogMeIn lost all my accounts.

As a technical support company, we have used LogMeIn for years to help us remotely administer client systems.  Many of those clients have 20-30 computers, or more, and we had loaded them all into our LogMeIn account for easy access by our technical support team.

We have many “free” accounts connected to it, and many “paid” accounts.  Some of our customers needed the “paid” features such as printer support, so we set them up with a paid account.

So our account, over the years, became a well-organized assortment of both paid and free LogMeIn accounts.  And we had a lot of them.

And then on March 5, 2013, LogMeIn sent the following email (excerpt):

“For nearly a decade, LogMeIn Free has provided unlimited free remote access to users on as many computers as they wish. In order to ensure that we can continue providing this free service and make meaningful improvements to it, we will be limiting the number of accessible Free computers in all remote access accounts to 10.”

We stopped reading around there.  But it goes on…

“Should you choose not to upgrade, only the first 10 Free computers in your account, according to alphabetical order, will be shown as available” … “These changes will take effect in just a few weeks, so act now to take advantage of our special rate.”

Well, we acted.  We moved all our customer systems (including the paid ones) onto our own hosted support solution and left LogMeIn a distant memory.  Didn’t have to think twice.  LogMeIn effectively pulled the plug on our business-customer relationship.

As a business owner, it’s important not to forget your customers.  They’re the ones who make your business work after-all.  In LogMeIn’s case, they made a stupid move. And unfortunately a lot of it has to do with communication.  I now know they are offering a reasonably priced “Central” service to allow the continued use, but their email didn’t mention anything about that in the first paragraph, and in big bold characters it simply stated, and I quote:  “Important message: Your account will soon be limited to 10 Free computers.”  We didn’t read any further before taking action.

So, in an effort to reduce the number of “free” accounts in use on their system, LogMeIn has also lost all our paid accounts.

It reminds me of when Neighbours (a coffee drive-thru) stopped taking debit as a form of payment.  Their focus was entirely on the wrong thing: the fees to run a debit machine.  Here’s the ripple effect: I used to get my coffee there each morning, and quite often a breakfast sandwich, but when they made that change, I didn’t waste any time (because I don’t carry cash)… I just drove across the road to Tim Hortons.  Stupid move on their part.  They’ve since re-introduced debit at their drive-thru.  Perhaps someone at the company woke up and realized they just cut out a large chunk of their business to save a few pennies per transaction.  Which costs more?

But where does that leave LogMeIn?  Their focus is obviously in the wrong place in the same way.  And we’ve gone elsewhere.

Own a business?  Think about your customer first, and then figure out how to make money while taking good care of your customer.  If you can’t be good to your customer, they’ll just go across the road and leave you wondering where all the business went.

– Robbie

Receive full Category5 Technology TV weekly episodes by email for free.

Here’s a new feature of our service which I’m really excited about…

Now, you can receive Category5.TV’s weekly episodes by email!

It looks something like this:

Receive Category5.TV episodes by email.

Receive Category5.TV episodes by email.

This is really exciting because it means you can receive this really cool (and non-spammy) reminder each week once an episode is available.  It’s not a dumb notice, or a “click here for our web site”.  It’s literally an email that gives you 1) a screenshot from the episode, 2) a description of what we did in the episode (the main topic), 3) direct links to download the episode for free and 4) a handy “play now” link which will open a player window and instantly begin streaming the show to your device.

Activate Weekly Email

To activate this awesome feature on your free account, simply login at Category5.TV and choose “Members” -> “My Profile”, and you’ll see the new option “Weekly episode by email” as per the above image.  Check it off and press Save Settings.  Don’t worry, you can turn it off at any time, and we never spam you (it’s against our beliefs as non-spammers)!

Don’t have an account?  No worries; it’s free, and easy!  Just visit http://register.category5.tv/ and sign up today.

Please activate the feature, and once you’ve received your mailout (comes out when each episode becomes available; usually Wednesday mornings), let me know what you think.  I would love to hear your comments below.

Thanks for watching Category5 Technology TV!  Thanks also to _Jot_ for assisting me with the beta testing.