HTTP headers
Cache-Control HTTP Header Meaning
Cache-Control sets caching rules for browsers and shared caches.
Meaning
The header defines how long a response can be reused and when it must be revalidated or stored.
Where it appears
Servers send it on responses; clients can also send request directives for cache behavior.
What to check
Check max-age, shared-cache directives, no-store rules, and whether the response can safely be cached.
Example
Cache-Control: max-age=3600, stale-while-revalidate=60Common values and directives
max-agemax-age=<seconds>Caches can reuse the response for this many seconds before revalidating.s-maxages-maxage=<seconds>Shared caches use this value instead of max-age.no-cache- Caches may store the response, but must revalidate before reuse.
no-store- Caches should not store the request or response.
private- Only a private browser cache may store the response.
public- Shared caches may store the response even when it would otherwise be restricted.
must-revalidate- Once stale, caches must revalidate before reuse.
stale-while-revalidatestale-while-revalidate=<seconds>Caches may serve stale content briefly while refreshing it in the background.stale-if-errorstale-if-error=<seconds>Caches may serve stale content when revalidation or origin fetch fails.
References
- Registry
- IANA HTTP Field Name Registry
- Guide
- MDN Cache-Control