
How CDN Works: Request Routing, Caching, and Edge Delivery
A Content Delivery Network (CDN) improves web performance by moving content closer to users through a globally distributed network of edge locations. When a user makes a request, routing mechanisms such as DNS-based routing, Anycast, and GSLB help direct traffic to an appropriate edge PoP. The CDN then checks its cache: on a cache hit, the edge serves the content directly to the user; on a cache miss, it retrieves the content from the origin, caches it according to rules such as TTL and Cache-Control, and returns the response. Edge locations can further improve delivery through TLS termination, HTTP/2, HTTP/3, persistent origin connections, compression, and image optimization. When content changes, cache invalidation, targeted purging, and versioned assets help keep cached content fresh without unnecessarily increasing origin traffic. Finally, metrics such as cache hit ratio, origin offload, TTFB, response time, and error rate help determine whether the CDN is actually reducing origin load and improving user experience.








