What is a CDN, how does it work, and what does it do for a system?
Short answer
A CDN is a network of edge servers around the world that keeps copies of content close to users instead of sending every request to the origin. Benefits: faster loads, less load on the origin, and a DDoS/WAF shield at the edge.
3 points to say:
- A hit is served straight from the edge; a miss goes to the origin and is stored per
Cache-Control. - Files with a hash in the name: cache for a year (
immutable); HTML and public pages: short TTL or purge. - Never let the CDN keep personal responses (
private/no-store); a full purge still dumps traffic on the origin.
Keep reading the deep dive
Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.