Commonline Manuals
Technical notes / Open reference
Contents ▾
GUIDE / CACHING

Caching is a shared agreement.

Caches save work when servers clearly describe freshness and when representations can be reused.

Freshness limits

Cache-Control: max-age=60 allows a shared understanding of the freshness lifetime under normal caching rules. A response can be revalidated before reuse, depending on the cache and the request.

A site that changes HTML regularly should use a shorter policy than immutable, fingerprinted build assets.

Revalidation

An ETag or Last-Modified header provides a way to ask whether a stored representation is still current. A conditional GET may receive 304 Not Modified when the cached representation remains valid.

GET /guide/ HTTP/1.1
Host: example.org
If-None-Match: "revision-a"

HTTP/1.1 304 Not Modified

Do not cache private results accidentally

Caching decisions affect correctness and privacy. Authenticated responses and user-specific pages need policies designed for their sensitivity. Do not copy cache directives from a public SVG onto a private account page.

For a small static site, ordinary server defaults and deliberate, simple policies are usually preferable to complex bespoke caching logic.