CDN Explained: How Content Delivery Networks Speed Up the Web

CDN explained in plain terms means a network of servers spread around the world that stores copies of a website close to its visitors, so pages load faster wherever people are. The central question is how a site in London can open quickly for someone in Sydney, and the short answer is that the content travels a short distance from a nearby server instead of crossing the world from the original one.

Every second of loading time matters. Studies of online shopping have repeatedly found that visitors leave slow pages, with each extra second of delay cutting conversions and pushing readers towards faster rivals. Search engines notice too, since page speed feeds into how pages are ranked.

A content delivery network, usually shortened to CDN, is the standard answer to that problem, and it sits behind most of the large sites you visit every day.

Key takeaways

  • A CDN is a network of servers around the world that stores copies of website content near visitors.
  • Serving content from a nearby server cuts the distance data travels and shortens loading times.
  • CDNs cache static files such as images, style sheets, and scripts, and refresh them when the original changes.
  • Beyond speed, CDNs absorb traffic spikes and block many attacks before they reach the origin server.
  • Dynamic, personalised content still needs the origin server, so a CDN speeds up part of a site, not all of it.

What a CDN is

A content delivery network is a group of servers, called edge servers or points of presence, placed in data centres across many cities and countries. Each one stores copies of a website’s files, so that a visitor in Tokyo is served by a server in Tokyo rather than one in Texas. The original server, known as the origin, still holds the master copy of the site, but it no longer answers every request itself.

The idea grew out of a simple problem. In the early web, every visitor fetched every file from a single server, wherever that server happened to be. As audiences became global, the distance itself became the bottleneck, because data travelling across oceans and continents takes time, and every network hop adds delay.

Today the largest CDNs operate thousands of servers in hundreds of cities, and their networks carry a large share of all internet traffic. Video platforms, news sites, online shops, and software companies all rely on them, and many smaller sites use them through providers such as Cloudflare, Fastly, and Amazon CloudFront. If you have ever watched a video that started instantly or opened a news page that appeared at once, a CDN was probably doing the work.

How a CDN works

The process starts before a single file is sent, with the question of which server should answer. When you type a web address, your browser first asks where to find the site, and the answer for a CDN-backed site points to the edge server nearest to you. Our guide to DNS explains how that address lookup works, and the CDN builds on it by returning a different nearby server for each visitor.

Once the browser reaches the edge server, the server checks whether it already holds the file requested. If it does, and the copy is still fresh, it sends it straight away, and the whole exchange may take a few tens of milliseconds. If the copy is missing or has expired, the edge server fetches a fresh copy from the origin, stores it for the next visitor, and then sends it on to you.

That first fetch is slower, but every visitor after it benefits from the cached copy.

The decision about what to cache is set by rules the site owner controls. Static files such as images, style sheets, scripts, and fonts are cached for hours or days, because they rarely change. Pages that change often are cached briefly or not at all.

Each cached item carries an expiry time, and the origin can also tell edge servers to discard a copy early when something important changes, such as a corrected price or a breaking news story.

A photograph of a dark server room at night with rows of server racks glowing green and a globe on a monitor
Edge servers in data centres around the world hold copies of popular content, so a visitor is served from nearby rather than from the origin.

CDN versus a single origin server

The contrast between serving a site from one server and serving it through a CDN is sharpest under load. A single server has one location, one connection to the wider internet, and one limit on how many requests it can answer at once. A CDN spreads all three across the world.

The table below sets out the difference.

Aspect Single origin server Content delivery network
Loading time Slow for distant visitors, fast for nearby ones Fast almost everywhere, served from the nearest edge
Traffic spikes One server takes the full surge and may fail Requests spread across many servers worldwide
Outages One failure takes the whole site down Other edge servers keep serving if one fails
Bandwidth costs Origin pays for every byte it sends Edge servers absorb most traffic, cutting origin costs
Attacks Malicious traffic hits the origin directly Bad traffic is filtered at the edge first
Setup Simple, nothing extra to configure Needs cache rules and cache clearing habits

What CDNs do beyond speed

Speed is the headline, but reliability is often the bigger prize. When a site is mentioned on television or a post goes viral, traffic can jump a hundredfold in minutes, and a single origin server would collapse under the surge. A CDN absorbs the flood by spreading requests across its edge servers, each answering a share, so the origin sees only a fraction of the load.

Many small sites have survived their first viral moment only because a CDN was already in place.

Security is the second benefit. Because all traffic passes through the edge first, a CDN can filter out much of the malicious traffic before it ever reaches the origin. Distributed denial of service attacks, which try to overwhelm a site with junk requests, are blunted when thousands of edge servers share the load.

CDNs also work hand in hand with the systems that share load inside a data centre. Where a CDN spreads traffic across the world, a load balancer spreads it across the servers in one place, making sure no single machine takes more than its share. Our guide to load balancing explains how that local sharing works, and the two together form the standard way large sites stay fast and stay up.

One handles geography, the other handles capacity, and both answer the same question: which server should handle this request.

Caching, the heart of the CDN

Everything a CDN does rests on caching, the art of keeping a copy close to where it will be needed. The key measure is the cache hit ratio: the share of requests answered from the edge without going back to the origin. A well-tuned site can reach hit ratios above ninety per cent, which means the origin answers only one request in ten.

A poorly tuned site, where everything expires too quickly, may barely benefit at all.

Getting caching right is a balancing act. Cache files for too long and visitors see stale content, such as yesterday’s prices or an old headline. Cache them too briefly and the edge servers keep fetching from the origin, throwing away the speed advantage.

The usual answer is to give each kind of content its own lifetime: images and fonts for weeks, style sheets until they change, and news pages for minutes.

Limits and trade-offs

A CDN cannot speed up everything. Content that is different for every visitor, such as a personal inbox, a bank balance, or a shopping basket, cannot be cached and shared, so those requests still travel to the origin. A CDN can shorten the route and keep the connection warm, but the origin still has to do the work.

Sites that are mostly dynamic gain less than sites that are mostly static, and their owners should expect a smaller improvement.

There are costs and complications too. CDN services charge for the traffic they carry, and a site with huge video files can run up a large bill, even though the per-gigabyte price is usually lower than serving from the origin. Cache invalidation can also surprise newcomers: after updating a page, the old copy may linger at the edge until it expires or is cleared by hand.

CDN checklist

  • Turn on a CDN before a traffic spike, not during one, so caches are warm when visitors arrive.
  • Cache static files aggressively, and give changed files new versioned names so old copies never linger.
  • Set short cache lifetimes for pages that change often, such as home pages and news articles.
  • Keep dynamic, personalised content off the cache, and let it travel to the origin every time.
  • Clear the cache deliberately after important updates, and check the live page from more than one location.
  • Watch the cache hit ratio, and investigate quickly if it falls without an obvious cause.
  • Use the CDN’s firewall and attack protection, and keep encryption switched on end to end.
  • Measure loading times from the places your visitors actually live, not only from your own office.
  • Keep a plan for CDN outages, including a way to serve the site directly from the origin if needed.

Frequently asked questions

What does CDN stand for?

CDN stands for content delivery network. It is a network of servers spread around the world that stores copies of website content close to visitors, so pages, images, and videos load faster wherever people are.

How does a CDN make websites faster?

A CDN shortens the distance data must travel by serving files from an edge server near the visitor instead of from the origin server.

Do small websites need a CDN?

Many do, and the cost is often low or free at the basic level.

What is an edge server?

An edge server is a server at the outer edge of a CDN, placed in a data centre near a group of visitors. It stores copies of a site’s files and answers requests from nearby users, so the origin server only handles requests the edge cannot answer itself.

Can a CDN help with security?

Yes. Because traffic passes through the edge first, a CDN can absorb distributed denial of service attacks, filter malicious requests, and add a web application firewall.

What is the difference between a CDN and web hosting?

Web hosting is where a site’s original files live, on the origin server. A CDN is a delivery layer on top of hosting that copies those files to servers around the world.

The bottom line

CDN explained in one line is this: a network of servers around the world that keeps copies of your site close to your visitors, so pages load fast, traffic spikes are absorbed, and attacks are filtered before they reach you.

For most sites with a geographically spread audience, a CDN is one of the cheapest performance wins available.

This article is general information about how content delivery networks work, not advice about which provider suits a particular website or budget.

Latest articles

Scroll to Top