About the Cache-Control Header Generator
Caching headers decide whether browsers and CDNs reuse a file or download it again, which affects both speed and correctness. Pick what you are serving — versioned static files, HTML pages, private data, per-user API responses or a CDN-cached public API — and get a sensible Cache-Control value.
Or choose Custom to set public or private, max-age, s-maxage, stale-while-revalidate, no-cache, no-store, must-revalidate and immutable yourself. The output includes ready-to-paste nginx, Apache and _headers (Netlify, Cloudflare Pages) snippets, and explains each directive in plain English.
How to use the Cache-Control Header Generator
- Choose a preset or Custom.
- Adjust the directives if needed.
- Copy the header or a server snippet.
Features
- Five presets
- Custom directives
- nginx, Apache and _headers
- Plain-English explanations
Supported formats
- Plain text
Frequently asked questions
Why “no-cache” for HTML?
It lets browsers keep the page but check for a newer version every time, so visitors never see stale HTML.
Is my text sent anywhere?
No. Everything runs in your browser, so nothing you paste is uploaded or stored.
Added · Last reviewed · Maintained by Sohail Khax · How we test tools