Tech foundations

What is a CDN (content delivery network)?

In short

A CDN (content delivery network) is a network of servers around the world that keeps copies of a website's files close to visitors, so pages load faster and the main server carries less load.

Data still travels at a limited speed, so distance matters. A visitor in Gothenburg gets the page from a nearby CDN server instead of from a server in another country. Most CDNs also work as a reverse proxy that blocks attacks.

Mini course

4 short lessons, about 2 minutes in total

  1. Distance still matters
  2. Caching: keeping copies
  3. More than speed
  4. Getting started

Lesson 1

Distance still matters

Even on fast internet, each request travels through cables and routers. A round trip to a server on another continent can take a tenth of a second, and a web page needs many trips. A CDN shortens the distance by placing copies of the website's files in hundreds of cities.

When a visitor opens the page, they get the files from the closest copy.

Lesson 2

Caching: keeping copies

The CDN keeps copies of images, styles, scripts and often whole pages. This is called caching. Each copy has an expiry time. When it expires, or when the site owner clears it, the CDN fetches a fresh copy from the origin server.

Visitor
Nearby CDN server
Internet
Copies of the website are kept on servers close to each visitor, so pages load fast wherever people are

Tap a box to open that concept

This is also why someone can see an old version of a page after an update: their nearby copy has not been refreshed yet.

Lesson 3

More than speed

Because the CDN sits in front of the website, it also acts as a shield. It can absorb floods of fake traffic, block known attackers and handle encryption. Many CDNs now also run small pieces of code close to the visitor, which is called edge computing.

This website uses Cloudflare as its CDN.

Lesson 4

Getting started

Check whether your web host already includes a CDN. If not, Cloudflare has a free plan that works for most small sites. After turning it on, test your pages with Google PageSpeed Insights and compare the scores before and after.

  1. Customers find youHow customers and AI tools find the companySEOGEOGoogle AI Overviews
  2. AI in daily workTools staff and customers useChatbotAI copilotVoice AI
  3. Building blocksHow AI connects to data and systemsRAG (retrieval-augmented generation)AI agentMCP (Model Context Protocol)
  4. AI modelsThe models that understand and createLarge language model (LLM)Generative AIMachine learning
  5. DataCompany data, gathered and cleanedData warehouseETLData quality
  6. InfrastructureCloud, networks and systems underneathCDNCloud computingDatabaseAPI key
Trust and rulesSecurity, law and control in every layerGDPR and AIEU AI ActAI guardrails
Where CDN sits in a company's AI setup

An everyday example

When you stream a film on Netflix, it usually comes from a server near your internet provider, not from the United States.

How companies use it

Companies use CDNs to make websites fast everywhere, survive traffic peaks and attacks, and score better on page speed, which affects Google rankings.

Frequently asked questions

Does a small website need a CDN?

A CDN helps even a small website, and many hosts include one for free. Speed affects both visitors and search rankings.

What is the origin server?

The server where the original website lives. The CDN fetches from it and keeps copies.

Do updates show up right away?

Website updates do not always show up right away behind a CDN. The CDN may show the old copy until it expires or is cleared, which is why a page can look old on a phone.

In depth: CDN

The full picture, about 4 minutes of reading

Why distance still matters online

A web page feels instant, but every file in it, from the text to each image, has to travel from a server to the visitor's screen. Data moves fast, but not infinitely fast, and it passes through many network hops on the way. A visitor in Luleå loading a site from a server in another country waits a little longer for every file than a visitor sitting next to that server. On a page with dozens of files, the small waits add up.

The server itself can also become the bottleneck. A single machine can only answer so many visitors at once. If a campaign or a news mention sends a sudden wave of traffic, it may slow to a crawl or stop answering altogether.

What a CDN does

A CDN, or content delivery network, solves both problems by keeping copies of a site's files on many servers spread across the world. These servers are often called edge servers, because they sit at the edge of the network, close to where people are.

The company's own server is called the origin. It holds the original version of the site. When a visitor asks for a page, the request goes to the nearest edge server instead of the origin. If that edge server already has a fresh copy of the file, it sends it right away. If not, it fetches the file from the origin once, keeps a copy and serves every later visitor in that region from the copy.

The result is shorter trips for visitors and far fewer requests reaching the origin, which can then spend its effort on the work only it can do, such as handling orders or logins.

Caching, and how updates reach visitors

Keeping copies is called caching. Each file carries instructions about how long a copy may be kept before the edge server must check with the origin again. Logos and style files that rarely change can be cached for a long time. A page showing stock levels or prices may be cached for a very short time, or not at all.

This explains a common surprise: you change something on the website and it does not show up right away. The edge servers are still serving the old copy. Most CDNs offer a purge function that clears the copies on demand, and modern website tools often do this automatically when you publish. Getting these settings right is most of the craft of running a CDN well. Cache too little and the benefit shrinks. Cache too much, or the wrong things, and visitors see outdated content.

More than speed

Many CDNs also act as a shield. Because all traffic passes through them first, they can absorb and filter attacks such as DDoS attacks, where huge numbers of fake requests try to knock a site offline. They can block known bad traffic, add a web application firewall that stops common hacking attempts and manage the certificates that put the padlock in the browser's address bar.

Some CDNs also let companies run small pieces of code at the edge, close to the visitor, for tasks such as redirects or simple personalization. And many give a clear view of traffic: where visitors come from, which files are requested most and what kind of automated visitors, including AI crawlers, are reading the site. Several CDNs now let site owners decide which AI crawlers may access their pages.

Limits to know

A CDN cannot fix a slow site on its own. If pages are heavy with huge images and too much code, a CDN delivers them from closer by, but they are still heavy. Personal content, such as a logged-in customer's order history, usually cannot be cached and still has to come from the origin.

Configuration mistakes can also cause real problems. A wrongly cached page can show one visitor's information to another, or keep an old price visible after it changed. And because so much traffic flows through a few large CDN providers, an outage at one of them can take many unrelated sites down at the same time. That is rare, but it is worth knowing which provider your site depends on.

What it means for a small business

Most small business websites already use a CDN without anyone choosing it. Common website builders and hosting services include one by default, and free plans from CDN providers cover the needs of a typical company site. The practical work is less about buying one and more about checking that it is switched on and set up sensibly.

Three things are worth checking. First, that images and other static files are cached, so the site loads quickly on mobile phones far from the server. Fast pages help visitors and are one of many signals search engines use. Second, that publishing a change clears the old copies, so customers never see outdated prices or opening hours. Third, that the CDN's settings for bots match your wishes: if you want AI assistants to find and recommend your business, make sure their crawlers are not blocked by default.

Curious what this could mean for your company? Book a call.

Book a call