Cache-Control Header Generator

Build a correct HTTP Cache-Control response header from plain toggles and human time units, right in your browser.

Your Cache-Control header is assembled locally in your browser from the options you pick, and nothing you configure is uploaded or stored on a server.

Wiring up a server? Try the nginx Config Generator.

About Cache-Control Header Builder

This cache-control header generator turns the confusing set of HTTP caching directives into a few plain toggles. Flip public or private, no-store, no-cache, must-revalidate, proxy-revalidate, or immutable, and set lifetimes like max-age, s-maxage, stale-while-revalidate, and stale-if-error using human units such as hours, days, or years instead of counting seconds. As you change options the tool composes the directives in canonical order, explains in plain English exactly what the current header does, and flags contradictory combinations like no-store with max-age. Presets cover the everyday cases: a one-year immutable static asset, always-revalidate HTML, never-store private data, and a split CDN-versus-browser policy. Copy the raw header or ready-made nginx, Apache, and HTML meta snippets. Everything runs on your device, in the browser.

Features

How to use the Cache-Control Header Builder

  1. Pick a preset or start from scratch and choose public or private.
  2. Toggle the directives you need, such as no-cache, must-revalidate, or immutable.
  3. Enter lifetimes like max-age using a number and a unit (hours, days, years).
  4. Read the generated header value and the plain-English explanation beneath it.
  5. Copy the raw header or the nginx, Apache, or HTML meta snippet you need.

Example

Input

public + immutable + max-age = 1 year

Output

Cache-Control: public, max-age=31536000, immutable

The classic fingerprinted static-asset policy: cache for a year and never revalidate.

Common errors & troubleshooting

Frequently asked questions

What is the difference between no-cache and no-store?
no-store means the response must never be written to any cache, so every request goes back to the origin. no-cache does allow storing the response, but the cache must revalidate it with the origin before serving it again. no-store is about not keeping a copy; no-cache is about always checking a kept copy is still current.
What does immutable do in a Cache-Control header?
immutable tells the browser the resource will never change for the lifetime of its max-age, so it can skip revalidation even when the user hits reload. It is meant for versioned or fingerprinted files like app.9f2c.js, where a new build ships under a new URL rather than overwriting the old one.
How do max-age and s-maxage differ?
max-age sets how long the response stays fresh in any cache, including the browser. s-maxage overrides max-age but only for shared caches such as CDNs and proxies. Setting both lets you cache a response briefly in browsers while keeping it longer on your CDN.
When should I use public versus private?
public lets shared caches like CDNs and proxies store the response along with the browser. private restricts storage to the individual user's browser, which is the right choice for personalized or authenticated responses that must not be served to another user from a shared cache.
What does stale-while-revalidate do?
stale-while-revalidate lets a cache serve a slightly stale response immediately while it fetches a fresh copy in the background. Users get an instant response and the cache updates itself for the next request, which smooths over the moment a resource expires.
Is my configuration sent to a server?
No. The header, explanation, and snippets are all assembled in your browser as you toggle options, so the configuration is processed locally on your device and nothing is uploaded.

Related tools

All ArrayKit tools