Cache-Control Header Generator

Pick a scenario or compose the directives yourself. Every directive is explained in terms of what the browser does versus what a shared CDN cache does.

The filename changes whenever the content does, so the response can be cached forever and never revalidated.

public: any cache may store it, including a shared CDN.

max-age=31536000: fresh for 1 year in the browser.

immutable: the browser skips revalidation entirely, including on a reload.

Cache-Control Header Generator — Free Online Tool

Builds a Cache-Control header from cacheability, freshness and revalidation options, with presets for immutable fingerprinted assets, HTML that must always revalidate, private user data and no-store responses, showing the resulting max-age in human-readable form and explaining what each directive tells the browser versus a shared CDN cache.

How to use the Cache-Control Header Generator

  • Open the tool above — it runs entirely in your browser, so your input never leaves this page.
  • Paste or type your input into the field, then press the relevant button (e.g. Encode / Decode, Generate, or Convert).
  • Copy the result from the output area with the copy button orCtrl/Cmd + C.
  • No signup, no upload, and no tracking — repeat as often as you need.

Frequently asked questions

What is the difference between no-cache and no-store?

no-cache still stores the response but revalidates with the origin before every reuse — a 304 keeps it cheap. no-store forbids writing it to any cache at all. If you meant "always check for a new version", you want no-cache.

When is max-age=31536000 safe?

Only on a URL whose content can never change — a fingerprinted asset such as app.a1b2c3.js. On a stable URL, a year of freshness means users keep the old file for a year, with no way for you to recall it.

What does s-maxage do that max-age does not?

It applies only to shared caches such as a CDN, and overrides max-age there. That lets you keep browsers revalidating constantly while the CDN absorbs the traffic — max-age=0, s-maxage=60 is a common API pattern.

Free & private — why use this Cache-Control Header Generator

The Cache-Control Header Generator runs 100% client-side in your browser. Your data is never uploaded to a server, no account is required, and the tool is completely free. It works offline once the page has loaded and is part of a growing collection of privacy-first developer utilities.

More network & http tools