What is a CDN and should you be using a one?

Published - Updated

Geolocation Content Delivery Network

In this post, we are going to take a closer look at how CDN’s (Content Delivery Networks) work and what the advantages and disadvantages are of using a CDN to delivery your users static assets such as images, CSS files or JavaScript files. You will learn what a CDN does exactly, how it can prevent your website from DDoS attacks.

What is a CDN?

A CDN or Content Delivery Network is a geographically distributed network of proxy servers. The goal is to provide high availability and performance by placing assets used on the internet close to end users. CDN is a term used for many types of content delivery systems, however we are referring to web and mobile content acceleration.

An example would be as follows:

User in London, England loads a website which uses a CDN to host its JavaScript, CSS and Image Files. The CDN will return the files from its EU server, rather than its US server to help reduce latency.

Should the EU server go offline for any reasons, the US server will return the static files instead.

What are the advantages of using a CDN?

The benefits of using a CDN extend further than just speeding up page requests.

  • Help with global reach
  • Save money of infrastructure costs
  • Provides 100% availability
  • Helps protect you from DDoS (Distributed denial of service) attacks

A CDN can also help reduce your server load, so your main websites server isn’t held up to server assets to the end user. The workload is handed off to the CDN provider.

What are the disadvantages of using a CDN?

Where there is an upside, there is also a downside to using a CDN.

  • A CDN is another cost
  • It adds complexity to your development and deployment procedures
  • Some customers who use your website may have network filters set up to to block certain Content Delivery Networks which will prevent your content from being loaded, resulting in a bad customer experience.
  • Geolocation may actually slow down your website loading its assets. If your server is in London, and all your customers are in London, but your CDN is in mainland Europe your content can actually load a lot slower.

So, should you use a CDN?

The advantages out way the disadvantages. Many of the worlds biggest website utilise Content Delivery Networks because their traffic is huge. However, if your website is for a local florist, then you may struggle to see the benefits.