Websites & hosting · Term

CDN (content delivery network)

A CDN (content delivery network) is a network of servers in many locations that keeps copies of a website's files and serves each visitor from a nearby server, so pages load faster and the main host carries less load.

A CDN does not replace hosting. Your site still lives on its origin server; the CDN sits in front and serves copies of what it is allowed to store, typically images, stylesheets, scripts and, with careful setup, whole pages. When it cannot answer from its copy, it fetches from the origin.

The speed gain comes mostly from distance. Data takes time to cross continents, so a visitor in another country reaches a nearby CDN server faster than your host. For a local business whose customers and server are in the same region, the gain is smaller, and the main benefits are offloading traffic and protection rather than raw speed.

How it works

A CDN runs servers at many points of presence around the world. When a visitor requests a file, the network routes them to a nearby edge server. If that server has a fresh copy, called a cache hit, it sends it immediately. If not, a cache miss, it requests the file from your origin server, sends it to the visitor and stores a copy for the next person.

How long a copy stays fresh is set by caching rules, either the headers your server sends or settings in the CDN's dashboard. When you change a file, you either wait for the copy to expire, purge it from the CDN, or give the file a new name or version number so the CDN treats it as new.

There are two common ways to connect one. Some CDNs act as a reverse proxy for the whole domain: you point your nameservers or DNS records at them and all traffic passes through. Others give you a separate address for assets, such as a CDN subdomain, and you change the site to load images from there. The proxy model also lets the CDN handle certificates and filter attacks before they reach your host.

Example

A tour operator's site has large photo galleries and visitors from several countries. After putting a CDN in front, the photos are delivered from servers close to each visitor, the host handles far fewer requests and the galleries load noticeably faster abroad. The booking pages, which change with every search, are set to bypass the CDN cache entirely.

To check it is working, the team opens a gallery image in the browser's developer tools and looks at the response headers. Most CDNs add a header showing whether the file was a cache hit or miss; a steady stream of misses on images means the caching rules need adjusting.

Why it matters for your business

A CDN can make a site faster for distant visitors, keep it reachable during traffic spikes and absorb some attacks that would knock a small host offline. Many offer a free or low-cost tier that suits small sites. The trade-offs are another account to manage and a new place where things can go wrong: a misconfigured CDN can serve outdated pages, cache a logged-in page for everyone or break forms. If your audience is local and the site is already fast, a CDN is a nice-to-have rather than a necessity.

Common mistakes

  • Caching pages that contain personal or logged-in content, so one visitor sees another's data.
  • Editing the site and forgetting to purge the CDN, then wondering why changes do not appear.
  • Switching nameservers to a CDN without copying the existing email records.
  • Assuming a CDN fixes a slow server response on pages it cannot cache.

Questions people ask

Do I need a CDN for a small business website?

Not always. If your visitors and your server are in the same region and the site is already fast, the benefit is modest. A CDN becomes more useful with visitors in several countries, heavy images or video, traffic spikes, or a need for extra protection against attacks.

Is a CDN free?

Some CDNs offer a free tier that covers basic caching and security for small sites, and many hosts include one. Paid plans add features such as image optimisation, advanced firewall rules and higher limits. Check what the free tier includes and what happens if traffic grows.

Does a CDN help SEO?

Indirectly. A CDN can improve load times and keep the site available, both of which support a good experience and page speed measurements that search engines consider. It does not change your content or rankings on its own, and a misconfigured CDN can cause problems for crawlers.

Related terms

Have something worth building right?