← Lessons

quiz vs the machine

Gold1390

System Design

The CDN for Object Delivery

Cache hot objects at edge locations near users so reads skip the origin store entirely.

5 min read · core · beat Gold to climb

Why an edge cache

The origin object store may sit in one region, far from users. A content delivery network places caches at many edge locations worldwide. A read served from a nearby edge is faster and never touches the origin, cutting both latency and origin load.

How it serves objects

  • On a cache miss the edge fetches the object from origin, stores it, and serves it.
  • On a cache hit later requests in that region are served from the edge.
  • A time to live and validation headers decide how long the edge may reuse a copy.

Keeping copies correct

Cached copies can go stale. Two patterns help. Versioned keys put a content hash in the URL so a changed object is a new URL the edge has never cached. Invalidation explicitly purges a key from edges, but it is slower and costlier, so immutable versioned URLs are usually preferred.

Key idea

A CDN caches objects at edges near users so reads skip the origin, and versioned URLs keep those cached copies correct without slow invalidation.

Check yourself

Answer to earn rating on the learn ladder.

1. What happens on a CDN cache miss?

2. Why are versioned URLs preferred over invalidation?