CDN (content delivery network)
CDN (content delivery network)
Bronze
A CDN keeps copies of static content on servers close to users, so most requests for images and assets never reach your origin — and arrive sooner.
- Use when
- Images, video and JS / CSS bundles · Users far from the origin · Spikes of requests for the same files
- Avoid when
- Personalized responses — mark them private so the shared cache never keeps them · Content that must never be served stale
- Trade-offs
- Freshness vs time to live — version file names instead of purging · Misses and uncacheable requests still reach the origin
- Requires
- Cache basics: hit ratio, TTL, eviction, Object storage
3 objectives · 8 misconceptions
- predict Predict the load on the origin for a given CDN hit ratio.
- explain Explain why answering from an edge near the user cuts latency.
- choose Choose what goes behind a CDN and how long it may be cached (TTL, versioned file names).
- Not true: A CDN speeds up every request, including personalized API responses.
- Not true: Behind a CDN the origin no longer needs any capacity.
- Not true: Changing a file updates every CDN copy at once.
- Not true: A CDN only matters for apps with users all over the world.
- Not true: Once a file is cached, every request for it is a hit.
- Not true: A CDN only makes responses arrive sooner — the origin still answers every request.
- Not true: A CDN only protects the origin from load; it doesn't make anything arrive sooner.
- Not true: Edge servers answer sooner because they are faster machines than the origin.
Learn
A CDN for the files everyone wantsMembers~12 minPractice
No katas practice this yet.
Check
Station test-out80% to passNeighborhood
→CDN (content delivery network)→
unlocksMulti-region