Explore how content delivery networks cache, serve, and invalidate content
The response can be cached and reused for N seconds without revalidation. After expiry, the browser must re-request.
Like max-age but only for shared caches (CDNs, proxies). Overrides max-age for CDN nodes. Browser still uses max-age.
Response can be cached by any cache — browser, CDN, proxy. Safe for static assets with versioned URLs.
Only the end-user's browser can cache this. CDN edges must not cache. Use for personalized responses.
Never cache this response anywhere. Every request goes to origin. Use for sensitive data like banking pages.
Response can be stored but must be revalidated every time (via ETag/If-None-Match). Not the same as no-store!
Once stale, must revalidate before use. Never serve stale content, even if origin is unreachable.
Content will never change during max-age. Browser won't make conditional requests. Use with content-hashed URLs.
A CDN deploys edge servers in dozens of global Points of Presence. When a user requests content, DNS routes them to the nearest PoP via Anycast or GeoDNS. The PoP serves cached content or fetches from origin and caches for future users in that region.
One of the two hardest problems in computer science. When content changes at origin, all edge caches must be notified.
Send DELETE request to CDN API for specific URL. Propagates to all edges in 1-30 seconds. Guaranteed fresh content.
Append content hash to filename: app.abc123.js. Old version stays cached. New version is fresh miss. Zero propagation delay.
Tag responses with logical keys (e.g. product:123). Purge all tagged responses in one API call.
Content expires naturally after max-age. No action needed. Use short TTLs (60s) for mutable content, long (1yr) for immutable.