Cache-Control
Directives for caching in browsers and intermediaries. Controls max-age, revalidation, and cacheability.
BothSyntax
Cache-Control: <directive>[, <directive>]*Example values
| Value | Explanation |
|---|---|
| max-age=3600 | Cache for 1 hour |
| no-cache | Revalidate before use |
| no-store | Do not cache |
| public, max-age=31536000, immutable | Versioned 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.