Why Cloudflare is the Best CDN (Even if it’s Free!)

Last updated on

I’ve been experimenting with a lot of different CDNs lately, and I’ve come to a realization. Cloudflare is the best CDN out of all the others in the market. It’s easy to take it for granted. It’s free, after all. It comes with most hosting plans out of the box.

Hosts like SiteGround for example, allow you to integrate with Cloudflare right from cPanel. Here’s a list of SiteGround coupon codes with prices starting at just $3.95/month.

I kept thinking “I should move to a paid CDN”. I don’t know, it was just an illogical assumption that because Cloudflare is free, it must be inferior in some way. So I tried. I tried KeyCDN. I tried BunnyCDN. For a while, I even used the “Site Accelerator” in the Jetpack plugin for WordPress. But time after time, in test after test, I found that Cloudflare’s CDN outperformed them all.

And for one simple reason. No additional DNS lookup and connection.

Every New Domain Adds HUGE Lag

The problem with using a regular CDN is that they serve their static resources from a hostname that isn’t yours. For example, for my site wp-tweaks.com, the CDN “pull zone” with BunnyCDN was:

wptweaks.b-cdn.net

So if I had a static resource on my site located at:

wp-tweaks.com/wp-content/themes/mocha/somecss.css

It would re-write to:

wptweaks.b-cdn.net/wp-content/themes/mocha/somecss.css

In the code. But because this domain is different from my site, the browser has to perform the connection dance all over again, including the DNS lookup, the SSL handshake, and the actual connection.

Here’s an illustration of the page loading from webpagetest.org using the BunnyCDN:

Additional DNS Lookup with a CDN

The initial connection time for my site is just over 200ms. Any further assets from my site will be served immediately without any handshake.

However, you can see that when the browser tries to get the resources from a CDN, it incurs an additional cost of 300ms just to resolve the name of the CDN itself!

Cloudflare Incurs NO Additional Lookup Cost

Because Cloudflare functions as a reverse proxy in addition to a CDN, there is zero additional latency when it serves its assets from its CDN network.

Here’s an illustration of the same web page load with Cloudflare:

Only One DNS Lookup with Cloudflare

You can see that the CSS and jQuery files are being served with blazing fast speed from Cloudflare’s EDGE cache. And it starts serving the assets immediately. No DNS lookup. No SSL handshake. No connection time. Because all that’s already been done with the very first request to my site. With Cloudflare, there needs to be just one handshake.

300ms is a LOT of Time

As website owners, even shaving out a few dozen milliseconds of loading time is a big deal. Which makes the massive 200-300ms of connection time to an external CDN seem massive by comparison. We must always try and clip the low hanging fruit first. And using Cloudflare as a CDN seems to be an easy decision.

What’s the point of spending so many resources improving page speed by 50ms, when there’s a much bigger target on the table?

Less Processing Load on the Origin Server

For a normal CDN, we’re probably going to use an automated tool or a plugin to rewrite the URLs. This creates an additional load on the server and slows down the response time. If you’re using shared hosting like I am, then you should always be on the lookout to eliminate this factor.

Integrate with Cloudflare’s “Argo” For even Faster Response Speeds

This is something I discovered relatively recently. For $5 a month, you can use a service called “Argo” from Cloudflare that does two things:

First, it makes Cloudflare use more efficient routing paths to your origin server, so everything is quicker. Here’s a comparison from my dashboard showing the benefits of Argo over the past 48 hours:

Cloudflare Argo Performance

As you can see, my site response time has gone down to 314ms instead of the 481ms it would have been without Argo. That’s 167ms or 35%!

Second, it uses something called tiered caching, which increases the hit rate of the CDN by 60%. What it does is that if an EDGE server doesn’t have a piece of static content, Cloudflare will ask other PoPs if they have it. And if they do, then it doesn’t have to request the origin server all over again – it gets the content from a nearby POP.

This not only reduces the load on your site, it also dramatically increases the speed of content transfer since it takes place between Cloudflare servers. Those familiar with KeyCDN, know that they call this an “Origin Shield”.

Argo Proof: Google’s “Page Download Time” Decreases

Ever since I enabled Argo on Cloudflare, the search console graphs in Google show a dramatic reduction in the time it takes for the Google bot to download a page on my site:

Page Download Time Google Search Console

In September 2018, Google’s John Mueller at Google said in a tweet that webmasters should try and bring their page download time to a “few 100ms”. And Argo certainly goes a long way towards accomplishing that!

Bottom Line: Cloudflare is the Best CDN

If you’re not using Cloudflare, you should be. Even if you’re currently paying for a CDN, I would suggest you migrate to Cloudflare. The additional DNS and connection times are not worth it. I’m convinced that a reverse-proxy style of CDN like Cloudflare is the way to go. And you can’t beat free!

Pair that with a service like Argo, and we have a no-brainer!

About Bhagwad Park

I've been writing about web hosting and WordPress tutorials since 2008. I also create tutorials on Linux server administration, and have a ton of experience with web hosting products. Contact me via e-mail!

Speak Your Mind

*