guide2 min read

HTTP Caching Guide

Understand browser caching, CDN caching, and Cache-Control headers.

HTTP caching layers: browser cache (local, per-user), CDN cache (edge, shared), origin cache (server-side). Key headers: Cache-Control: max-age=3600 (cache for 1 hour), Cache-Control: no-cache (revalidate every time), Cache-Control: immutable (never changes — use for hashed assets), ETag (content fingerprint for revalidation). Strategy: immutable for hashed CSS/JS (style.abc123.css), short max-age for HTML, no-cache for API responses.