← Lessons

quiz vs the machine

Silver1060

Networking

The CDN Cache Hierarchy

How edge, regional, and origin layers form a cache pyramid.

4 min read · intro · beat Silver to climb

Why A Hierarchy

A CDN does not store every object on every server. Instead it arranges caches in layers so popular content lives close to users while rare content is fetched on demand.

The Layers

  • Edge cache: a server in a point of presence near the user, holding the hottest objects.
  • Regional cache: a larger middle tier that serves several edge nodes.
  • Origin: the customer server that holds the authoritative copy.

A request walks up the pyramid only as far as needed. If the edge has the object, the climb stops there.

How A Miss Travels

When the edge lacks an object, it asks the regional layer. If the region also misses, the request reaches origin. The fetched object is then stored on the way back down, so the next user is served locally.

  • Each layer absorbs misses from the layer below it.
  • Fewer requests reach origin, which lowers origin load and cost.
  • Latency drops because most responses come from nearby caches.

Trade Offs

More layers mean more places to keep fresh and more memory to manage. Designers balance hit rate against the overhead of coordinating many caches.

Key idea

A CDN stacks edge, regional, and origin layers so each tier absorbs misses from below, keeping hot content near users and shielding origin from load.

Check yourself

Answer to earn rating on the learn ladder.

1. What happens when an edge cache misses an object?

2. Why does a cache hierarchy lower origin load?