Skip to content
Engineering

CDN

Definition

A Content Delivery Network (CDN) is a system of distributed servers that store and deliver web content, such as images, videos, and stylesheets, to users based on their geographic location. This helps reduce latency and improve page load times.

Diagram

How a CDN serves filesThe origin server is in one place. Edge servers in Lagos, London and Singapore keep copies of its files. Each user is served by the nearest edge in tens of milliseconds; an edge only fetches from the origin when it doesn’t have a file yet, then keeps it.Origin serverone location, e.g. VirginiaedgeLagos~18 msedgeLondon~12 msedgeSingapore~21 msonly on a miss
Distance costs time: a request across an ocean can take well over 100 ms each way, while a nearby edge answers in tens. CDNs suit files that are the same for everyone, such as images, video and scripts; personalized pages still come from the origin.

Case study

Worked example