Cache-Control Builder
Build an HTTP Cache-Control header from presets or individual directives, with a plain-language explanation and warnings for conflicting directives.
Cache-Control Builder
Freshness lifetimes
Directives
Cache-Control: public, max-age=3600
What this does
- Shared caches (CDNs, proxies) are allowed to store this response.
- Fresh in the browser for 3600s (1 hour); served without a network request until then.
Updated . Provided as is. Check the output before you rely on it in production.
How to use Cache-Control Builder
- 1
Pick a preset or start fresh
Choose a preset like Static asset or API no-store to load sensible directives, then adjust the values from there.
- 2
Set visibility and lifetimes
Choose public or private, then enter max-age, s-maxage, stale-while-revalidate, or stale-if-error values in seconds.
- 3
Toggle directives
Enable directives such as immutable, must-revalidate, or no-transform. The builder warns you about combinations that conflict.
- 4
Read the explanation
Review the plain-language summary describing how browsers and shared caches will treat the response.
- 5
Copy the header
Copy the assembled Cache-Control header and paste it into your server, framework, or CDN configuration.
Questions and answers
What is the Cache-Control header?
What is the difference between max-age and s-maxage?
When should I use no-store?
Does the tool check for conflicts?
Is the header built locally?
For AI agents: how to call this tool
Machine-readable contract, endpoints and examples. Humans can ignore this section.
Best Path For Builders
Browser workflow
Runs instantly in the browser with private local processing and copy/export-ready output.
Browser Workflow
This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.
/cache-control-builder/
For automation planning, fetch the canonical contract at /api/tool/cache-control-builder.json.