Start a project

Tool 176 of 194 · HTTP

HTTP Caching Header Simulator

Paste your response headers and a few requests, and watch where each one is answered: browser cache, CDN or origin, before and after a deploy.

HTTP Caching Header Simulator at a glanceIllustration: 1, Cache-Control; 2, processed in your browser; 3, Cache timeline.HTTP Caching Header Simulator1Cache-Control3Cache timeline2In yourbrowser
1 Cache-Control 2 processed on your device 3 Cache timeline

HTTP Caching Header Simulator

Response and traffic

Times like 90s, 5m, 2h or 1d.

    Timeline

    • Served from cache
    • Old version after the deploy
    • 304 revalidation
    • Passed on or fetched
    TimeVisitorBrowserCDNOriginVersion

    Where requests were answered

    Recommended headers

    Recommended for this kind of response

    01

    What it does

    Plays a request schedule through each visitor's browser cache, a CDN and your origin, so you can see hits, 304s and stale copies after a deploy.

    • RFC 9111 freshness: s-maxage, max-age, Expires and the 10% heuristic
    • Separate browser caches per visitor and one shared CDN
    • Age carried from the CDN into the browser's lifetime
    • no-cache, no-store, private, immutable and must-revalidate

    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 cache-by-cache timeline, hit counts and recommended headers, with a Copy and a Download button on every result.

    • Caching
    • HTTP
    • CDN
    • Performance

    Why it matters

    Caching bugs rarely show up when you set the headers. They show up days later: a deploy goes out and some visitors get yesterday's HTML pointing at deleted JavaScript, or an API keeps serving an old price for five minutes, or the CDN never caches anything because of one stray directive. The directives interact in ways definitions don't make obvious: s-maxage only applies to the CDN, a browser that gets its copy from the CDN counts the CDN's Age against its own max-age, and no-cache doesn't mean don't cache.

    This simulator applies the RFC 9111 rules step by step. Each visitor has their own browser cache, everyone shares one CDN, and each request is followed through both to the origin and back. You see which layer answered, whether it was a full download or a 304, and which visitors got the old version after a deploy and for how long. Checks flag conflicting or risky headers, and each preset comes with recommended headers. It's a model of a standard cache: individual CDNs have extra rules, so check yours.

    How it works

    1. InputResponse headers and a request schedule
    2. In your browserEach request through browser, CDN and origin
    3. OutputHits, 304s, stale copies and better headers

    Where it fits in a designer's workflow

    1. Plan
    2. Design
    3. Build
    4. Test
    5. Launch
    Setting caching headers you won't regret after the next deploy.

    By the numbers

    Requests that reached the origin, per presetHTML page, max-age=3600: 2 of 7 reached the origin; Hashed file, immutable: 1 of 5 reached the origin; API JSON, s-maxage + SWR: 2 of 7 reached the originHTML page, max-age=36002 of 7 reached the originHashed file, immutable1 of 5 reached the originAPI JSON, s-maxage + SWR2 of 7 reached the origin
    Simulated by this tool with its three presets and their request schedules. The HTML preset served the old page to 3 requests for up to 30 minutes after the deploy; the API preset to 2, because s-maxage keeps the CDN copy after the browser's max-age runs out. The hashed file needed 1 origin request in a week. Source: RFC 9111: HTTP Caching; RFC 5861: stale-while-revalidate.
    Show the numbers as a table
    PresetRequestsBrowser cacheCDNOriginOld version served
    HTML page, max-age=360073223
    Hashed file, immutable52210
    API JSON, s-maxage + SWR71422

    How to use it

    1. Pick what the response is, or paste your own response headers.
    2. List requests as a time and a visitor letter: 0 A, 2m B, 1h A.
    3. Set when a new version is deployed.
    4. Read the timeline and the summary, then compare with the recommended headers.

    FAQ

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

    no-store means don't keep a copy at all. no-cache means keep it, but check with the server before every use; with an ETag that check is a small 304 instead of the whole response.

    Why did the browser's copy expire early?

    When a browser gets its copy from a CDN, the response carries an Age header saying how long the CDN has had it. The browser counts that against max-age, so a 10-minute max-age with Age: 2 minutes leaves 8.

    What does stale-while-revalidate do?

    For a set time after expiry, a cache can answer at once with the stale copy and fetch a fresh one in the background. Visitors get speed; the next one gets the new version.

    How do I avoid old pages after a deploy?

    Give static files a content hash in the name and cache them for a year with immutable. Keep HTML short-lived at the CDN, revalidated in the browser, and purge the CDN when you deploy.

    Does it model my CDN exactly?

    It models a standard RFC 9111 shared cache and reads CDN-Cache-Control. CDNs add their own rules, such as minimum TTLs, ignoring some directives or caching only some file types, so check your provider's docs.

    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