Skip to content

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

Header
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. 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. 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. 3

    Toggle directives

    Enable directives such as immutable, must-revalidate, or no-transform. The builder warns you about combinations that conflict.

  4. 4

    Read the explanation

    Review the plain-language summary describing how browsers and shared caches will treat the response.

  5. 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?
Cache-Control is the HTTP response header that tells browsers and CDNs whether a response may be cached, for how long, and when to revalidate. This builder assembles it from presets or directives such as max-age, s-maxage and stale-while-revalidate, explains the result and flags combinations that cancel out.
What is the difference between max-age and s-maxage?
max-age sets freshness for the browser's private cache, while s-maxage overrides it for shared caches such as CDNs and proxies. Use s-maxage to cache longer at the edge than in the browser.
When should I use no-store?
Use no-store for sensitive or per-user responses that must never be cached anywhere. It is stronger than no-cache, which allows storage but requires revalidation with the origin before each reuse.
Does the tool check for conflicts?
Yes. It flags directive combinations that cancel out, such as no-store with max-age or no-cache with immutable, and describes the resulting behavior for browsers and CDNs in plain language.
Is the header built locally?
Yes. The header string and its explanations are assembled in your browser from the directives you toggle. Nothing is sent to a server, so your configuration stays on your machine.
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.