Free — no signup required

Edge Caching: CDNs and POPs

2 min read

Moving Data Closer to Users

Even with Geo-DNS pointing users to the right region, if a website's origin server is in a single data center in Virginia, a user in Sydney, Australia still has to wait for data to travel roughly 16,000 km round-trip. At the speed of light through fiber (approximately 200,000 km/s), that's a minimum of 160ms of latency — before any processing time. For a page that requires dozens of requests, this adds up fast.

The solution is a Content Delivery Network (CDN).

A CDN is a globally distributed network of servers designed to serve content from locations physically close to end users. CDNs operate hundreds of small data centers called Points of Presence (POPs) in major cities worldwide — at the "edge" of the internet, close to where users actually are.

How it works:

  1. You configure your domain to point to the CDN (e.g., via a CNAME record).
  2. Static content — images, videos, JavaScript files, CSS, fonts — is cached at CDN POPs around the world.
  3. When a user in Sydney requests your page, Geo-DNS routes them to the nearest Australian POP.
  4. The POP serves the cached content directly, without the request ever reaching Virginia.

The first time a POP receives a request for a piece of content it hasn't cached yet, it's called a cache miss — the POP fetches the content from the origin server, caches it locally, and serves it. Every subsequent request for the same content from that region is a cache hit — served instantly from local storage.

Cache TTL (Time To Live) controls how long a POP keeps a cached copy before checking the origin for a fresh version. This is set via HTTP response headers like Cache-Control: max-age=3600 (cache for 1 hour).

CDNs also provide benefits beyond latency:
- DDoS absorption: CDN POPs can absorb massive traffic volumes that would overwhelm a single origin server.
- TLS termination at the edge: Encrypted connections are terminated at the nearest POP, reducing handshake latency.
- Compression and optimization: Many CDNs automatically compress responses and optimize images.

Key Point: CDNs reduce latency by caching content at the network edge, close to users. They also provide resilience, DDoS protection, and performance optimization as secondary benefits.

This is one of 18 chapters

Every chapter is free — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

Sign up free