HTTP caching headers
A practical guide to HTTP caching: Cache-Control directives, freshness and max-age, ETag and Last-Modified validation with conditional requests and 304 responses, Vary, Expires and Pragma, recipes for static assets, HTML, APIs and private data, and how to debug caching in the browser.
CodexBash, , 5 min read
The fastest request is the one that never happens. HTTP caching lets browsers, CDNs and proxies reuse earlier responses, sometimes without contacting your server at all, sometimes with a tiny "nothing changed" exchange. Configured well, it makes sites feel instant and cuts server load dramatically. Configured badly, users see stale pages after deployments, or worse, one user's private data is served to another. Our CDN article covered caching at the edge; this one is the complete guide to the headers that control every cache, browser included.
Sign in to read the rest
The whole 5 minute article is free with an account, along with every problem, lesson and tutorial. No card.