What is a CDN and why your website would use one?
So what exactly is a CDN?
(Updated: 2017-09-05. Cleared up "Considering a CDN?"), added Fastly
CDN is short for Content Delivery Network or Content Distribution Network, which is a network of servers that deliver cached static content from websites to users based on the geographic location of the user. Makes total sense doesn’t it? No? Alright, let’s break it down.
Normally when you visit a website, the website is opened from a single location where the website is hosted on a server (most likely your website also shares this server with many others), this could be in the same location where you live or it could be halfway around the world in another country. The further away it is from you, the longer it takes to open. This also means that every user on your website is accessing this one server to view your website, for most websites this is not a problem, but if you have a high volume of traffic, it could overload the server causing a slow loading site or even server crash.
The speed at which your website opens for visitors in the last few years has become increasingly important. Not only is it a well-known fact that search engines like Google, takes into account a website’s performance in determining its ranking on the service, but more and more people expect a website to be fast. In a recent study done by Akamai found that 47% of people expect websites to load within 2 seconds and 40% of people consider 3 seconds taking too long to wait for a website to load.
This is where a CDN becomes quite handy because it is a network of servers that are spread through out the world. What a CDN does when your website makes use of one, is store all your static content(this includes images, stylesheets, javascript files, etc.) on all of these servers. So when a user visits your website, the CDN determines which server in its network is the closest to the user and redirects them to that server, making the website faster for the user and also distributing the load on more servers rather than just the one.
Akamai predicts that 55% of global web traffic will pass through CDNs by 2018 (up 36% in 2013).
What if I told you that your website is most likely already making use of a CDN?
Now not the full CDN experience where all of your bandwidth heavy static content is distributed, no, but commonly used little pieces and how it helps your website and more importantly the user.
Many web developers use third party libraries like jQuery and Bootstrap to improve their layout and functionality. To reduce server load and speed up access for users, many of these libraries are provided on CDNs.
One of the benefits of loading these commonly used libraries from a CDN is browser caching.
What is browser caching you might ask? Well, when you visit a website, your web browser (Google Chrome, Mozilla Firefox, Internet Explorer, etc.) downloads all the static resources that the website uses and stores it on your computer, so that the next time you visit the website again it will load the website faster and save you a little bit of data by not having to download everything again if it did not change. So say you visit Website A, which makes use of jQuery’s CDN and then later visit Website B which also uses the same jQuery CDN, your web browser will recognize that it has downloaded the same jQuery file from the CDN for Website A and will not download it again for Website B, saving you precious data and time.
So do you need a CDN for your website?
If the website is for a local business and majority of your web traffic and the website is hosted locally. Then you probably don’t need a CDN, a CDN also comes with the added cost, as a CDN is an extra service on top of your web hosting (Yes, you still need your original web hosting with a CDN), as the CDN only makes a duplicate of your static content and still needs the originals.
You could move to cheaper web hosting when using a CDN, as the CDN will bear the brunt of the web traffic and load. The money spared could be used on a CDN.
If the website receives high volumes of traffic or caters for a global audience, then yes, it will benefit allot from a CDN. With the added benefit of most CDNs providing DDoS protection (Something you might have heard of in the news recently, with major websites being taken temporarily offline by the means of a DDoS attack).
Considering a CDN?
As one of the biggest and most well-known cloud hosting providers Amazon Web Services, with many of the major news and shopping websites you most likely visit every day making use their online storage component, Amazon S3. But unfortunately, AWS at time of writing has no local servers or plans to expand to South Africa.
CDN’s with presence in South Africa:
One the largest CDN providers is CloudFlare, with data center’s in Johannesburg and the recently opened (May 2017) Cape Town.
Fastly‘s recent Johannesburg addition.
Coming soon to South Africa:
Microsoft’s Azure CDN, Microsoft plans to open data centers in Cape Town and Johannesburg by 2018.
KeyCDN also with a planned expansion in Cape Town.
Written by staff member M