Back to roadmap
Module 4 · Edge: DNS, CDN, Load BalancersDay 03125 min

CDN Architecture

Move bytes close to users so origin only answers misses.

Day 031

CDN Architecture

User
client
POP
edge
Origin Shield
edge
Origin
service
Signal path
CDN hierarchy from edge to origin
User
client
flow
POP
edge
POP
edge
flow
Origin Shield
edge
Origin Shield
edge
flow
Origin
service
Memory hook

CDN Architecture: move bytes close to users so origin only answers misses

Mental model

move the first decision closer to the user

Design lens

CDN is cheap; engineering time is the cost.

Recall anchors
ModelsHierarchyWins

Why it matters

A CDN is a worldwide network of caches at network edges. Static and cacheable dynamic content is served from the nearest POP, dramatically lowering latency and origin load.

Deep dive

Pull CDN (most common): on miss, fetch from origin and cache. Self-managing.

Push CDN: you upload assets to the CDN; origin doesn't see traffic. Used for large media or fixed bundles.

Hierarchy: edge POP → regional cache → origin shield → origin. Each layer absorbs misses for the next.

Demo / scenario

Site has p95 of 600ms; 80% of bytes are static.

  1. Front static with CDN.
  2. Versioned filenames (hash) → cache forever.
  3. HTML cached briefly with stale-while-revalidate.
  4. Origin load drops 90%; p95 to 150ms.

Tradeoffs

  • CDN is cheap; engineering time is the cost.
  • Cache invalidation gets harder than caching.
  • Personalized content needs careful Vary headers.

Diagram

User
POP
Origin Shield
Origin
CDN hierarchy from edge to origin.

Mind map

Check yourself

Loading quiz…

Sources & further reading