The Distance Problem
speed of light is the enemy:
user in Manila ──► origin in Virginia ≈ 14,000 km
round trips accumulate: TCP handshake + TLS + request/response
even perfect servers can't beat geography: ~200ms+ floor
CDN solution: move COPIES of content to ~300 cities worldwide:
Manila user ──20ms──► [Manila edge] ─(occasional miss)─► origin
What a CDN Physically Is
three components:
EDGES servers in datacenters/ISPs worldwide;
cache + terminate traffic close to users
SHIELD/MID intermediate tier protecting origin from
simultaneous edge misses
ORIGIN your servers — the source CDN pulls from
routing magic (anycast): ONE IP announced globally;
BGP delivers each user to their nearest edge.
no client configuration; DNS/CNAME points your domain at it.
What CDNs Deliver
| Capability | Mechanism |
|---|---|
| Latency | Proximity: 200ms → 15ms for far users |
| Origin offload | 90–99% hit rates on static content |
| Scale absorption | Viral spikes served from edges |
| DDoS shielding | Attack traffic absorbed/dropped at edge |
| TLS termination | Edges handle handshakes; keep key management centralized |
| Modern protocol | HTTP/2/3 to users even if origin speaks HTTP/1.1 |
The Economics
without CDN:
every user-byte crosses your cloud's egress (expensive)
origin fleet sized for GLOBAL peak simultaneously
with CDN:
origin sees misses only → smaller fleet
CDN egress typically cheaper per GB than cloud egress
regional spikes flatten into distributed hits
CDNs usually PAY FOR THEMSELVES in bandwidth alone
before counting performance.
Static vs Dynamic Content
STATIC (images, JS, video): cached everywhere; the classic win
SEMI-STATIC (API GETs): short TTLs at edge — increasingly common
DYNAMIC/personalized: not cacheable BUT still proxied through
edges → benefit from persistent connections, TLS reuse,
route optimization back to origin ("acceleration" mode)
modern CDNs are full application platforms:
edge compute (own lessons), security products, analytics.
Integration Mechanics
simplest path:
cdn.yourapp.com CNAME → yourcdn.net (asset domain)
full-site proxy mode:
www.yourapp.com → CDN → origin (everything proxied;
CDN decides per-response what to cache) config-driven rules)
purging: by URL or tag when content changes unexpectedly
(bad image uploaded, price error published)
Interview Framing
“Global product, images are slow for Asia-Pacific users” = CDN question. Scored shape: name proximity as root fix, quantify latency delta, cover offload economics, mention anycast routing and purge strategy, then extend to semi-static API caching as bonus depth. CDNs should appear in nearly EVERY design answer’s diagram — omitting them reads as inexperience.
Premium Content
Unlock What Is a CDN and all premium lessons with a subscription.
All premium lessons
Ad-free experience
Priority support
From ₹199.99/year — See plans