Back to Blog
April 6, 20241,000 views

CDN in System Design: Edge Servers, PoPs, Anycast & Origin Offload (Visualized)

A Content Delivery Network (CDN) is a globally distributed network of edge servers that cache and serve content close to users, cutting latency and offloading the origin. This guide covers PoPs, anycast routing, caching, and dynamic acceleration β€” with live animations.

A Content Delivery Network (CDN) is a geographically distributed network of servers that cache content close to users, so requests are served from a nearby edge location instead of a single distant origin. The result is lower latency, less load on your origin servers, and better availability under traffic spikes.

Every time you load a website's images, scripts, or videos quickly from anywhere in the world, a CDN is almost certainly involved. Providers like Cloudflare, Akamai, and Fastly operate thousands of edge locations worldwide.

Why Distance Matters

Data travels at a finite speed. A round trip from Sydney to a server in Virginia is ~200ms before any processing β€” and a single page can make dozens of requests. By placing a copy of your content in a Point of Presence (PoP) near the user, a CDN turns that 200ms into a few milliseconds.

Edge cache hit vs origin miss
On a cache HIT the edge serves content directly (fast); on a MISS it fetches from the distant origin once, then caches it for next time.

PoPs and Anycast Routing

A CDN deploys PoPs β€” clusters of edge servers β€” in data centers across the globe. When a user makes a request, the CDN routes them to the nearest healthy PoP, usually via anycast: many PoPs advertise the same IP address, and the network delivers the request to the closest one automatically.

Global PoPs serve regional users
Each region's users are served by their nearest edge PoP in parallel, instead of every request traveling to one central origin.

Caching and Origin Offload

Edge servers cache content according to Cache-Control headers and TTLs. Because most requests for popular assets are served from cache, only a small fraction β€” cache misses and uncacheable requests β€” ever reach your origin. This origin offload is what lets a modest origin survive massive traffic.

Origin offload and hit ratio
Most requests are absorbed at the edge (HIT); only misses pass through to the origin. A high hit ratio shields the origin from load.

Static vs Dynamic Content

CDNs excel at static assets (images, CSS, JS, video) that can be cached for long periods. For dynamic or personalized content, CDNs still help via dynamic acceleration: terminating TLS at the edge, reusing warm origin connections, optimizing routing, and caching at the edge for short windows or with stale-while-revalidate.

CDN Benefits at a Glance

ConcernWithout a CDNWith a CDN
LatencyOne distant origin for everyoneServed from a nearby edge PoP
Origin loadEvery request hits the originMost absorbed at the edge
AvailabilityOrigin is a single bottleneckEdges absorb spikes; origin shielded
Global reachFar users are slowConsistent speed worldwide
SecurityOrigin directly exposedEdge absorbs DDoS, hides origin

Key Concepts to Know

Origin shield: a designated mid-tier cache that all PoPs consult before the origin, collapsing many misses into one origin fetch. Cache key: what identifies a cached object (URL + selected headers). Purge/invalidation: explicitly clearing cached objects when content changes. Hit ratio: the share of requests served from cache β€” the single most important CDN health metric.

Frequently Asked Questions

What is the difference between a CDN and a cache?

A cache is the general technique of storing copies of data for fast reuse. A CDN is a globally distributed system of caches (edge servers) placed close to users. So a CDN is a cache β€” specifically a geographically distributed edge cache plus the routing to reach it.

Does a CDN help with dynamic, uncacheable content?

Yes, even when content can't be cached. Through dynamic acceleration β€” TLS termination at the edge, optimized backbone routing, and reused origin connections β€” a CDN reduces round-trip overhead. It can also apply short TTLs or stale-while-revalidate to safely cache semi-dynamic responses.

What is the difference between a CDN and a load balancer?

A load balancer distributes traffic across servers, usually within one region/data center. A CDN distributes cached content across many global locations to serve users from nearby. They're complementary: a CDN sits at the edge in front of your origin, which may itself sit behind a load balancer.

A CDN moves your content to where your users are. The closer the bytes, the faster the experience β€” and the calmer your origin.

β€” alokknight Engineering