Caching

A cache policy is part of the asset contract. Make that contract explicit.

Immutable, versioned files

Use a content fingerprint in the filename when an asset will receive a long cache lifetime. A new version gets a new URL. This response illustrates a versioned stylesheet.

Immutable, versioned files
Demonstration
HTTP/2 200
Content-Type: text/css; charset=utf-8
Cache-Control: public, max-age=31536000, immutable
ETag: "content-fingerprint"

Mutable documents

Pages and reference manifests can change. Require revalidation so browsers may reuse stored content only after checking freshness with the server.

Mutable documents
Demonstration
Cache-Control: no-cache
Last-Modified: <publication date>

Compression and representations

Build-time compression keeps delivery work small. Content-Encoding describes the selected representation, while Vary: Accept-Encoding keeps compressed and uncompressed responses distinct.

Compression and representations
Demonstration
Content-Encoding: br
Vary: Accept-Encoding

Cache controls are not a global network

These are HTTP delivery patterns, not a claim about distributed coverage. Managed purge APIs and distributed cache controls are still in development.