Designing a CDN: Put Popular Content Near Its Readers
Algomi Research · Created 2026-09-16 · Updated 2026-10-15 · System Design
Every school in the country, borrowing from one building
Vivek runs the platform behind PathShala, a national e-textbook site. Twenty million students open textbook chapters, diagrams and short videos, all served from one data centre in Mumbai. A student in Dibrugarh waits six seconds for each page. On exam-results day, the board's announcement banner goes up, and the origin servers fall over. (Vivek, PathShala and every number here are made up for teaching.)
Picture every school in the country borrowing books from one building. The travel alone takes too long. Small local libraries that keep copies of the popular books nearby would fix that.
A content delivery network (CDN) does the same for pictures, scripts, videos and other web content:
- Its nearby servers are called edges.
- The original content lives at an origin.
- An edge reuses a saved copy, a cache entry, when the request and the content's rules allow it.
Unlike a library book, a digital copy doesn't disappear when someone reads it. The hard problems are deciding which copy a reader should get, how long it stays valid, and who may see it.
| What happens to PathShala | Idea it forces |
|---|---|
| "Students in Assam wait six seconds a page" | Edges, origin, request routing |
| "A Hindi student got the English diagram" | The cache key is a correctness decision |
| "The corrected chapter still shows the old version" | Freshness, validation, purge, versioned names |
| "Results-day banner flattened the origin" | Stampedes, request coalescing, shield tier |
| "How many servers? How much will it save?" | Honest capacity estimates |
| "Teachers' answer keys must never be cached publicly" | Private content, signed URLs, operations |
In 30 seconds, as an architect would frame it: "I'd split the CDN into a data plane (edges, an optional regional shield, then the origin) and a control plane that distributes configuration and purges. Edges keep serving if the control plane blips. The cache key is a correctness decision: tenant, host, path, the query parameters that matter, and declared variants. Freshness comes from HTTP caching headers plus versioned file names, and purges are tracked as distributed operations. Stampedes are handled by request coalescing and the shield. Private content is authorised on every hit, not just on the first fetch."
Scope. This design serves public static assets and explicitly authorised private media. It should cut response time and origin traffic while respecting freshness and privacy. Video transcoding and a full internet routing service are separate systems.
Don't promise a fixed worldwide latency. Distance, mobile networks, object size, edge load and misses all affect it. Measure latency by region and percentile, because a national average can hide Dibrugarh.
1. "Six seconds a page in Assam": edges, origin and routing
You've reached the free preview of this post.
Subscribe to the Blogs plan (₹99/mo) — or use any Algomi Suite, Career, Investor, or Trader plan — to keep reading.
See plansSources
- HTTP caching standard — IETF (RFC 9111)