Start a project

Tool 67 of 100 · HTTP

Cache-Control Explainer

Paste the headers of any response and see, in plain English, how long a browser and a CDN may reuse it, when they must check back, and what's contradictory.

Cache-Control Explainer at a glanceIllustration: 1, Response headers; 2, processed in your browser; 3, How long it's cached.Cache-Control Explainer1Response headers3How long it's cached2In yourbrowser
1 Response headers 2 processed on your device 3 How long it's cached

Cache-Control Explainer

Response headers

What caches will do

Browser

Result

CDN or proxy

Result

Directives and checks

DirectiveMeaning

    Build a header

    Header

    01

    What it does

    Reads response headers per RFC 9111 and shows how long browsers and CDNs may reuse a response, plus a header builder.

    • RFC 9111 freshness for private and shared caches
    • max-age, s-maxage, Expires and heuristic freshness
    • stale-while-revalidate and stale-if-error
    • Conflicts such as no-store with max-age

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    A caching timeline and a Cache-Control header, with a Copy and a Download button on every result.

    • HTTP
    • Caching
    • CDN
    • Headers

    Why it matters

    Caching is the biggest performance win on the web and the most confusing header. no-cache doesn't mean 'don't cache', s-maxage only applies to CDNs, and a missing header still lets browsers cache with a guessed lifetime.

    This explainer applies the HTTP caching standard (RFC 9111) to the headers you paste and draws a timeline for a browser and a shared cache. The builder turns plain choices (who may store it, for how long, and what happens when it goes stale) into the right header.

    How it works

    1. InputResponse headers or a Cache-Control value
    2. In your browserRFC 9111 rules for browsers and CDNs
    3. OutputFreshness, revalidation and a fixed header

    Where it fits in a designer's workflow

    1. Plan
    2. Design
    3. Build
    4. Test
    5. Launch
    Setting caching before launch and debugging stale pages.

    By the numbers

    How long each example stays fresh (log scale)Hashed asset: browser: 1 year; Hashed asset: CDN: 1 year; HTML page: browser: 0 (revalidate); HTML page: CDN: 0 (revalidate); Account page: browser: 0 (revalidate); Account page: CDN: not stored; No store: browser: not stored; No store: CDN: not stored; Risky CDN: browser: 0 (revalidate); Risky CDN: CDN: 10 minutes; No header: browser: 2.1 days; No header: CDN: 2.1 daysHashed asset: browser1 yearHashed asset: CDN1 yearHTML page: browser0 (revalidate)HTML page: CDN0 (revalidate)Account page: browser0 (revalidate)Account page: CDNnot storedNo store: browsernot storedNo store: CDNnot storedRisky CDN: browser0 (revalidate)Risky CDN: CDN10 minutesNo header: browser2.1 daysNo header: CDN2.1 days
    Worked out by this tool's own RFC 9111 rules. With no Cache-Control at all, caches may guess: 10% of the time since Last-Modified, which is why the last example still gets cached for days. Source: RFC 9111: HTTP caching.
    Show the numbers as a table
    ExampleBrowserShared cache or CDN
    Hashed asset1 year1 year
    HTML page0 (revalidate)0 (revalidate)
    Account page0 (revalidate)not stored
    No storenot storednot stored
    Risky CDN0 (revalidate)10 minutes
    No header2.1 days2.1 days

    How to use it

    1. Paste the response headers (from DevTools or curl -I).
    2. Tick the box if the request carried an Authorization header.
    3. Read the timeline and the notes.
    4. Or use the builder to write a new header.

    FAQ

    What's the difference between no-cache and no-store?

    no-cache allows storing but needs a check with the server before each reuse. no-store means don't keep a copy at all.

    Why does a CDN cache longer than the browser?

    s-maxage applies only to shared caches such as CDNs, so you can keep the browser short and the edge long.

    What's heuristic freshness?

    With no max-age or Expires, caches may guess, commonly 10% of the time since Last-Modified. It's usually better to say what you want.

    Is anything fetched?

    No. It only reads the headers you paste.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk