All articles

October 27, 2026 · 3 min read

What is a CDN? Bringing your site closer to your visitors

A CDN keeps copies of your site on servers around the world and answers from the place closest to each visitor. How it works, its limits, and what to use it for.

  • performance
  • basics

A CDN (Content Delivery Network) is a set of servers spread around the world that keep copies of your site and answer each visitor from the point closest to them. The result: less distance to travel, so pages show up faster.

The analogy: the bakery and its depots

A bakery that bakes everything in one oven at the far end of the country would force every customer to make the trip. Smarter: it delivers its loaves to depots, one per city. The customer picks theirs up around the corner. The bakery itself is only called on to restock the depots.

Your origin server is the bakery. The CDN servers are the depots.

Why distance matters

Data travels fast, but not instantly. Each round trip between the visitor and the server takes a little time, more so when the distance is large. A page is made of many pieces (images, styles, scripts), and each one needs its own trip. If your server is far from your visitor, those delays add up.

How it works

  1. A visitor asks for an image from your site.
  2. The CDN routes the request to the nearest server.
  3. If that server already has a copy, it sends it back right away. If not, it fetches it from you, keeps it, then sends it.
  4. The next visitor in the same region gets the copy that is already ready.

It is exactly the principle of a cache, applied at world scale.

What goes there

  • Files that rarely change: images, fonts, stylesheets, scripts.
  • Sometimes whole pages, when they are the same for everyone (a showcase site, a blog post).

A CDN also relieves your server: it receives fewer requests, since part of them are served elsewhere. That can help when traffic grows.

Its limits

  • Stale copies: if you change a file, the copies already distributed must be refreshed. You set a lifetime, or ask the CDN to purge the copy.
  • Personal pages: an account, a cart, a dashboard cannot be shared. A visitor must never be served another visitor's page.
  • Data that changes every second: it goes through your application, not through a copy.

So a CDN is not a magic wand. If slowness comes from too many queries or a poorly built database, it will not fix it: see why an app is slow for the other causes. And to understand how your site talks to the rest of the world, read what an API is.

Key takeaway

A CDN brings copies of your site closer to visitors. It is useful for anything that is identical for everyone, as long as you control how copies are refreshed and never put personal content in it.

And for your product?

Knowing what to put behind a CDN, with what lifetime and without exposing personal data, shows in the configuration. A code audit of your app checks these settings along with the rest. If you like, we can talk about it in a 30-minute call.