Skip to content

What Is a CDN? Content Delivery Networks Explained

How content delivery networks use caching and nearby servers to speed up websites, what they add for security, and when a small site actually needs one.

How to Redesign a Website · Last reviewed October 19, 2026 · 5 min read

If your website lives on a single server in one city, every visitor's browser has to reach that one machine, whether they are across the street or across an ocean. Distance adds delay, and a sudden rush of visitors can overwhelm a modest server. A content delivery network, or CDN, is one of the most common ways websites deal with both problems.

You may already be using a CDN without knowing it, because many hosts and website builders include one. This guide explains what a CDN does, how caching makes it work, the speed and security benefits, the downsides to watch for, and how to judge whether your small site needs one.

What a CDN Is

MDN Web Docs defines a CDN as a group of servers spread across many locations that store duplicate copies of data, so requests can be answered by whichever server is closest to the visitor.

Two terms come up constantly. The origin is your actual web server, where the original files live. The edge servers, sometimes grouped into points of presence, are the CDN's machines in data centers around the world. Visitors connect to a nearby edge server instead of traveling all the way to your origin.

An analogy: imagine a company that ships every order from one central warehouse. It works, but distant customers wait longer. Opening regional warehouses stocked with the most popular items means most orders ship from somewhere close by. A CDN does the same for your website's files.

How Caching Makes It Work

A cache is a stored copy of something so it can be reused instead of fetched again. CDNs rely on caching:

  1. A visitor in a particular region requests a file, such as your logo or a product photo.
  2. If the nearby edge server doesn't have it yet, which is called a cache miss, it fetches the file from your origin, delivers it and keeps a copy.
  3. The next visitor in that region gets the stored copy straight from the edge, which is called a cache hit.
  4. The copy is kept for a set period, controlled by instructions sent with each file, such as the Cache-Control header, before the edge checks for a fresh version.

Some content suits caching better than others. Images, stylesheets, scripts and fonts change rarely and can often be cached for long periods. Personalized content, such as shopping carts or account pages, generally shouldn't be shared between visitors. Web.dev notes that even frequently changing content can sometimes benefit from caching for just a few seconds.

When you update your site, old copies may linger at the edge until they expire. MDN points out that many CDNs let you purge, or clear, cached copies through a dashboard or an API, so updates appear right away.

Speed Benefits

A CDN can make a site faster in several ways:

  • Shorter distances: data travels less far, which reduces delay, especially for distant visitors.
  • Faster connections: the secure connection setup happens with a nearby edge server rather than a distant origin.
  • Less strain on your server: the origin handles fewer requests and has more capacity for the rest.
  • Handling spikes: web.dev notes that CDNs are well suited to traffic surges, such as a promotion or local news coverage.
  • Modern features: many CDNs support newer protocols like HTTP/2 and HTTP/3, compression and, on some plans, automatic image optimization.

Google's web.dev guidance on Largest Contentful Paint, one of the Core Web Vitals speed measures, lists serving resources from a CDN among the ways to shorten load times.

Security and Reliability Benefits

Because a CDN sits between visitors and your server, many providers also offer protective features. Depending on the provider and plan, these can include absorbing large floods of malicious traffic (known as distributed denial-of-service, or DDoS, attacks), a web application firewall that filters suspicious requests, managed HTTPS certificates, and the ability to keep serving some cached pages if your origin is briefly unavailable.

These features vary considerably between providers and plans, so check what is actually included rather than assuming.

Possible Downsides

CDNs aren't free of trade-offs:

  • Visitors may see outdated content after an update until the cache expires or is purged.
  • A misconfiguration can accidentally cache pages that should be private, such as account pages.
  • It adds another service, account and set of settings to manage.
  • Troubleshooting can be harder, because problems may come from the CDN or from your origin.
  • MDN notes that loading files from a separate third-party CDN can add extra lookups and connections.

Does a Small Site Need One?

Start by finding out whether you already have one. Many website builders and managed hosts serve sites through a CDN by default. Ask your host or check your plan details. If you are still unsure, a developer can usually confirm it quickly by looking at your DNS settings and how your pages are being served.

A CDN is especially worth considering if:

  • Your visitors are spread across a wide region or several countries
  • Your pages carry many images or large files
  • You expect occasional traffic spikes from campaigns, seasonal demand or media mentions
  • Your server responds slowly to distant visitors

It may be less pressing if your audience is local and close to your server and your site is light. Even then, many CDN providers offer free or low-cost entry plans, so the barrier to trying one can be low.

One caution: a CDN delivers your pages faster, but it doesn't make heavy pages light. Oversized images and bloated scripts still need fixing at the source.

Key takeaways

  • A CDN stores copies of your site's files on servers around the world and serves visitors from the nearest one.
  • Caching is the core mechanism, and purging lets you push updates out quickly.
  • Benefits can include faster loading, less server strain, resilience to traffic spikes and added security features.
  • Many hosts and builders include a CDN already, so check before adding another.
  • A CDN complements, but doesn't replace, a well-optimized website.

Sources

Spotted something out of date? Let us know.

More in Web Tech Explained