Tech Terms Explained Open in the app →

CDN

Networking · Beginner · 4 min read

What is it?

A CDN is a network of servers spread around the world that store copies of your content close to users so it loads faster.

Explain like I'm 5

A CDN is like having a local branch of a store in every city, so you don't have to travel to the one faraway warehouse every time you need something.

Why was it created?

Serving everything from one location is slow for distant users. CDNs were created to cache content near users and reduce load on the origin server.

Where is it used?

  • Serving images, video, and static files
  • Caching web pages globally
  • Absorbing traffic spikes
  • Protecting and accelerating APIs

Why should developers care?

CDNs are standard for fast, scalable websites. Front-end and infrastructure engineers configure them regularly.

How does it work?

The CDN keeps cached copies of your files at edge locations worldwide. When a user requests content, the nearest edge serves it directly; if it's not cached, the edge fetches it from your origin and stores it.

Real-world example

A user in Tokyo loads a site whose origin is in the US; the images are served from a nearby Tokyo edge node in milliseconds instead of crossing the ocean.

Common use cases

  • Speeding up global content delivery
  • Reducing origin server load
  • Handling traffic surges
  • Mitigating some attacks at the edge

Advantages

  • Faster loads for distant users
  • Reduces load on your servers
  • Scales to traffic spikes
  • Improves reliability

Disadvantages

  • Cache invalidation can be tricky
  • Stale content if misconfigured
  • Added cost and configuration

When should you use it?

When you serve static assets or pages to a geographically spread audience.

When should you avoid it?

For purely dynamic, per-user data that can't be cached, the benefit is limited.

Alternatives

Serving directly from originRegional server deployments

Related terms

CachingDNSLoad BalancerAmazon CloudFrontHTTP

Interview questions

Beginner

  • What is a CDN for?
  • What is an edge location?

Intermediate

  • What is cache invalidation?
  • What kinds of content benefit most from a CDN?

Senior

  • How would you design cache headers for mixed static and dynamic content?
  • How do CDNs help with availability during spikes?

Common misconceptions

  • "A CDN speeds up everything" — it mainly helps cacheable content, not unique per-user responses.
  • "A CDN replaces your server" — it caches content from your origin, which still serves the source of truth.

Fun facts

  • CDN stands for Content Delivery Network.
  • Edge nodes are sometimes called points of presence (PoPs).

Timeline

  • 1998 — First commercial CDNs emerge

Learning resources

Quick summary

A CDN caches your content on servers worldwide so users get it from a nearby location, making sites faster and more resilient.

Cheat sheet

  • Globally distributed cache
  • Serves content from the nearest edge
  • Speeds up static assets
  • Reduces origin load

If you remember only one thing

A CDN puts copies of your content near users so it loads fast everywhere.