Cache-Control

Directives for caching in browsers and intermediaries. Controls max-age, revalidation, and cacheability.

Both

Syntax

Cache-Control: <directive>[, <directive>]*

Example values

ValueExplanation
max-age=3600Cache for 1 hour
no-cacheRevalidate before use
no-storeDo not cache
public, max-age=31536000, immutableVersioned asset, cache 1 year

cURL usage

curl -I https://example.com/asset.js  # Check response Cache-Control

Common mistakes

Using no-cache when you mean no-store; missing immutable for hashed assets.

Related headers

Tools

HTTP Header Viewer →