How CDNs Work
Why a site loads fast whether you're in Tokyo or Toronto.
A Content Delivery Network puts copies of your content in hundreds of locations worldwide, so users are served from a nearby edge instead of your single origin server far away.
Legend — how to read this diagram
How a request is served
- Anycast routing. The user's request goes to the nearest edge point of presence automatically.
- Cache hit. If the edge already has the file, it returns it immediately.
- Cache miss. Otherwise the edge fetches from origin, stores it, and serves it.
- TTL & purge. Cached copies expire on a TTL or can be purged when content changes.
Beyond speed
Offload. The origin handles a fraction of traffic, saving cost and load.
Resilience. Edges absorb spikes and shield the origin from DDoS.
Dynamic too. Modern CDNs run code at the edge, not just cache static files.
Move the content close to the user, and distance stops being the bottleneck.
No comments:
Post a Comment