All posts
·4 min read

What Is a CDN and How Does It Work?

A CDN is a network of servers distributed globally. Instead of serving all users from one central server, a CDN copies your content to many edge locations and serves each user from the closest one.

How it works

When a user requests your website, DNS routes them to the nearest CDN edge node. If the CDN has the content cached, it returns it immediately. If not (a cache miss), it fetches the content from your origin server, caches it, and serves it. Future requests for the same content are served from cache.

What it improves

  • Latency: content is physically closer to the user, reducing round-trip time.
  • Throughput: edge servers handle traffic in parallel, reducing load on a single origin.
  • Availability: if your origin has an issue, cached content keeps the site up for most users.
  • Bandwidth cost: serving from cache means less data transferred from your origin infrastructure.