What is a CDN and how does it work
CDN or Content Delivery Network is —in simple terms— a group of computers spread all around the world, which stores your website’s documents (photos, videos, etc.) so it can, at a later stage, offer them to your website’s visitors at a much higher speed. To explain in detail what a CDN is, I’ll have to get a wee bit more technical…
Proof it works and is very well worth it!
This blog runs on a server in Frankfurt, Germany. When I access it from my home country (Czech Republic), it loads lightning fast because the distance and number of hops (one of the tech terms) is minimal.
Using GTmetrix, I tested the page load speed as if accessing the site from London, UK (this is the only European location GTmetrix has on the menu).
Here’s the result:
NOTE: I’ve blurred out the Total Page Size and Requests areas so it doesn’t distract you.
You might be thinking ‘wow, that’s a great page load time, why would you need to add a CDN when it’s already so fast?’.
Well, let’s change the test server to —say— Sydney. Here’s what happened:
See that page load time? It’s terrible! And you know what they say: if it doesn’t load in under 3 seconds, it’s as if your website didn’t exist.
This is where a CDN comes in handy. If you expect your website to be visited from around the world, this is a great way to improve things for your visitors (and increase chances of them coming back, even doing business with you at some stage). A CDN provider stores copy of your static resources on its many servers so it can shorten the distance between your website’s files and the visitor’s web browser.
There, indeed, is such a thing as a free lunch
…or should I say a free CDN service? In the many years of using content delivery networks I found out that even CloudFlare’s free plan does wonders.
On top of speeding up your website, it adds extra layers of security, cache control and a few other things. Here’s how it improved my blog’s performance:
Whoa! What a difference, right? Even PageSpeed and YSlow scores have improved.
Adding a CDN is easy
Adding a CDN to the mix is very easy – register with your preferred provider, add your site to your account, and follow the instructions on how to change your name servers.
Name server changes can take up to 48 hours so don’t expect miracles the moment you add your site. In my experience with CloudFlare though, the changes usually propagated within a few minutes.
If you have a website and expect international visitors coming to it, adding a content delivery network to your setup is a must.
Not only will it improve page load speeds for the folks out there but it will also add an extra layer of security and allows you to control caching and other code optimisations of your website.
There are several providers to choose from but CloudFlare and its free plan stays my all time favourite. Adding site to CloudFlare is simple enough for anyone to complete, and even with setting left at their defaults, your website and visitors will thank you.