Concept

How Edge Caching Works

Points of Presence (PoPs) and Routing

A Content Delivery Network operates a geographically distributed network of caching servers — called Points of Presence (PoPs) or edge nodes. When a user makes a request, DNS or Anycast routing directs them to the nearest PoP, not to the origin server. This dramatically reduces the physical network distance their request must travel.

Cache Hit vs Cache Miss Flow

Cache Hit: The PoP holds a cached copy of the requested content. It responds immediately from local memory or disk — typically 5–30ms. The origin server is never contacted.

Cache Miss: The PoP does not hold a cached copy (either it expired, was never cached, or the PoP is receiving this request for the first time). The PoP fetches the content from the origin server, caches it locally, serves it to the user, and answers all future requests for the same content from its local cache until the TTL expires.

What to Cache at the Edge

  • Always cache — Static assets: Images, CSS, JavaScript bundles, fonts, video files. These are identical for every user. Use long TTLs (days to months) combined with versioned filenames for cache-busting. This is where CDN provides the highest impact.
  • Cache carefully — Public non-personalized content: Public API responses, blog posts, product pages for anonymous users. Use shorter TTLs (minutes to hours) with Cache-Control: s-maxage.
  • Never cache — Personalized content: Shopping carts, user dashboards, account information, authentication tokens. Use Cache-Control: private, no-store. Caching personalized content and serving it to the wrong user is a critical security and privacy failure.