Glossary

HTTP Caching (Cache-Control)

HTTP caching lets browsers and proxies store responses and avoid round-tripping to the server. Controlled by the Cache-Control header and related headers. Proper caching is the fastest optimisation: the best request is one never sent.

Key Cache-Control directives

ETag and Last-Modified

ETag is a content hash. On the next request the browser sends If-None-Match. The server returns 304 Not Modified if the content has not changed — no response body. Saves bandwidth.

Strategy for static assets

Static files with a hash in the filename (app.abc123.js) → Cache-Control: public, max-age=31536000, immutable. Infinite cache; a new deploy means a new hash = a new URL.