What Is a CDN? Explained Simply

A CDN (Content Delivery Network) is often mentioned when setting up or improving a website. It sounds technical, but the idea is actually quite simple.

What is a CDN?

A CDN is a network of servers located in different parts of the world. Instead of your website being served from one single location, copies of your website are stored across multiple locations.

When someone visits your site, the CDN delivers the content from the server closest to them, making the website faster and more reliable.

How does a CDN work?

When a visitor requests your website, the request is routed through the CDN. The CDN then decides which server is best placed to respond, usually the one geographically closest to the user.

This reduces the distance the data has to travel and improves loading speed.

Why do websites use a CDN?

Speed

Content is delivered from a location closer to the visitor, reducing load times.

Reliability

Traffic is distributed across multiple servers, helping prevent overload on a single server.

Security

Many CDNs provide protection against attacks and help hide the origin server.

I will cover security in another post.....

A note on security

One of the additional benefits of using a CDN is improved protection against certain types of attacks, such as Distributed Denial of Service (DDoS).

A DDoS attack attempts to overwhelm a website by sending a large volume of traffic to it, making it slow or completely unavailable.

Because a CDN distributes traffic across multiple servers and sits between your website and the visitor, it can absorb or filter this traffic before it reaches your main server.

This is another example of how a CDN can improve reliability, not just speed.

Attacks from devices don't just come from computers, they can come from any internet connected device which is a good reason to be cautious when sharing your network. Protecting a website also means protecting your network.

Do you always need a CDN?

Not always. For smaller websites or sites with a local audience, a CDN may not make a noticeable difference.

However, for websites with visitors in different locations, or those looking to improve performance and resilience, a CDN can be very useful.

Where problems can occur

Like many web technologies, a CDN adds another layer to your website. If not configured correctly, it can create conflicts.

Common issues include:

  • HTTP and HTTPS conflicts
  • Redirect loops
  • Caching problems

These issues often arise when both the server and the CDN try to control the same behaviour.

For example, if the CDN forces HTTPS while the server responds with HTTP, this can lead to a loop. See: ERR_TOO_MANY_REDIRECTS

Quick checks

  • Check SSL / HTTPS settings in your CDN
  • Ensure your server and CDN agree on HTTPS
  • Review redirect rules
  • Check DNS settings

Further reading

For a deeper technical explanation, see: What is a CDN? – Cloudflare