Free Cache-Control Header Analyzer

Parse and understand Cache-Control headers. Visual builder and best practice recommendations. Free, fast, and works entirely in your browser with no sign-up required.

Updated

Share:
Home/Website Tools/Cache-Control Header Analyzer

Cache-Control Header Analyzer

Parse and understand Cache-Control headers. Visual builder and best-practice recommendations.

Analyze Cache-Control Header

Common Cache Patterns

Static Assets (1 year)

public, max-age=31536000, immutable

API Response (no cache)

no-store, no-cache, must-revalidate

HTML Pages (revalidate)

no-cache, must-revalidate

CDN with SWR (5 min)

public, max-age=300, stale-while-revalidate=60

Private user data

private, no-store

Long CDN, short browser

public, max-age=3600, s-maxage=86400

Frequently Asked Questions

What is the Cache-Control Header Analyzer?

The Cache-Control Header Analyzer is a free online tool that parse and understand cache-control headers. visual builder and best practice recommendations. It runs entirely in your browser with no installation or sign-up needed.

What directives are explained?

All Cache-Control directives including max-age, no-cache, no-store, public, private, must-revalidate, and more.

Can I build a Cache-Control header?

Yes — toggle directives in the builder mode to generate the header string.

Is it free?

Yes, completely free.

Is my data safe with this tool?

Absolutely. The Cache-Control Header Analyzer processes everything client-side in your browser. No data is uploaded to or stored on any server. Your content remains private on your device at all times.

Does the Cache-Control Header Analyzer work on mobile devices?

Yes, the Cache-Control Header Analyzer is fully responsive and works on smartphones and tablets. You can use it on any device with a modern web browser -- no app download required.

Do I need to create an account to use this tool?

No account or registration is needed. Simply open the Cache-Control Header Analyzer in your browser and start using it immediately. There are no sign-up walls or usage restrictions.

How do I use the Cache-Control Header Analyzer?

Simply enter your input in the provided field, adjust any settings to your preference, and the tool will process it instantly. You can then copy the result to your clipboard or download it.

Which browsers are supported?

The Cache-Control Header Analyzer works in all modern browsers including Chrome, Firefox, Safari, Edge, and Opera. For the best experience, use the latest version of your preferred browser.

What is the difference between max-age and s-maxage in a Cache-Control header?

Both set a freshness lifetime in seconds, but they target different caches. max-age tells every cache — including the visitor's browser — how long the response stays fresh before it must be re-fetched or revalidated. s-maxage applies only to shared caches like CDNs and proxies, and when present it overrides max-age for those caches while leaving the browser's max-age untouched. This lets you cache a response aggressively at the CDN edge while keeping a shorter or different lifetime in the browser, for example public, max-age=3600, s-maxage=86400 for a one-hour browser cache and a one-day edge cache. This analyzer reports the browser cache and the CDN cache as two separate badges, so paste your header above to see exactly how long each layer will hold the response.

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

Despite the similar names, these directives do opposite things. no-store forbids caching entirely: neither the browser nor any CDN may keep a copy, so every request goes back to the origin. It is the right choice for sensitive responses like banking pages or personal account data. no-cache does allow the response to be stored, but the cache must revalidate it with the origin server before serving it again, so the user always gets verified-fresh content without a full re-download when nothing has changed. A common pattern is no-cache for HTML so new asset references appear immediately after a deploy, and no-store only where privacy demands it. Paste a header above and the analyzer labels each directive by category — freshness, revalidation, or audience — so the behavior is clear at a glance.

How long is max-age=31536000 and why is that value so common?

max-age is always expressed in seconds, and 31,536,000 seconds equals exactly one year (60 x 60 x 24 x 365). It is the conventional maximum because most caching guidance treats a year as effectively permanent. You see it paired with immutable on fingerprinted static assets — files whose names include a content hash, like app.4f2a9c.js — because a new build produces a new filename, so the old file never needs to change and can be cached for as long as possible. The immutable directive additionally tells browsers not to send revalidation requests on reload during that window. Computing durations by hand is error-prone, so this tool converts any max-age or s-maxage value back into readable units like hours and days, letting you sanity-check a header before shipping it. Paste one above to decode it instantly.

Why does my website still serve old content after I deploy a fix?

Stale content after a deploy almost always traces back to a too-aggressive Cache-Control header on the HTML document. If the page was sent with a long max-age and no revalidation directive, browsers and CDNs keep serving the cached copy — along with its old references to your CSS and JavaScript — until that lifetime expires, so users never pick up the fix. The safe fix is to serve HTML with no-cache (or a very short max-age plus must-revalidate) so it is revalidated on every visit and immediately reflects new asset references, while keeping long, immutable caching only on hashed static files. Remember that CDN edge caches obey s-maxage independently, so a stale edge can outlast a fresh browser. Paste the page's Cache-Control header above to see whether it is being cached too long.

What does stale-while-revalidate do and when should I use it?

stale-while-revalidate lets a cache serve a slightly outdated response instantly while it fetches a fresh copy from the origin in the background, so the next visitor gets the update without anyone waiting on a slow round-trip. You set a window in seconds — for example public, max-age=300, stale-while-revalidate=60 means the response is fresh for five minutes, then may be served stale for up to one more minute while it refreshes behind the scenes. It is ideal for content that can tolerate brief staleness, like CDN-cached pages and API responses where perceived speed matters more than absolute freshness. A related directive, stale-if-error, serves a stale copy when the origin returns an error, improving resilience. Paste a header containing either directive above and the analyzer explains the exact behavior and timing.

Embed This Tool

Add a free, live version of this widget to your own website or blog post — it runs entirely in your visitors' browsers, with a credit link back to The Toolbox.

Copy & paste this HTML
<iframe src="https://getthetoolbox.com/embed/cache-checker" title="Free Cache-Control Header Analyzer — The Toolbox" width="100%" height="280" style="max-width:480px;border:1px solid #e2e8f0;border-radius:12px" loading="lazy"></iframe>
<p style="font-size:12px;margin:4px 0 0"><a href="https://getthetoolbox.com/website-tools/cache-checker?utm_source=embed&utm_medium=widget" target="_blank" rel="noopener">Free Cache-Control Header Analyzer</a> by The Toolbox</p>

About the Cache-Control Header Analyzer

The Cache-Control Header Analyzer turns a cryptic HTTP header into a plain-language explanation. Paste a value like public, max-age=3600, must-revalidate, press Parse, and the tool breaks the header into its individual directives, tells you how long browsers and CDNs are allowed to keep the response, and explains what each token actually does. It is built for front-end and back-end developers, DevOps engineers, and anyone fixing why a deployment didn't go live or why a static asset keeps re-downloading.

Everything happens in your browser. The tool parses the header string you type — it does not fetch any URL, contact a server, or store your input. There is no sign-up, no rate limit, and no software to install, so it is safe to paste headers from staging, internal apps, or production without anything leaving your device.

What the analyzer shows you

When you parse a header, the tool produces two things. First, a visual summary that translates the directives into a real cache lifetime: a green badge with a human-readable duration (for example, "1 hour" instead of max-age=3600), or a clear "Not cached" / "Must revalidate" state when no-store or no-cache is present. It reports the browser cache and the CDN / shared cache separately, because s-maxage and private change how shared caches behave independently of the browser.

Second, a directive-by-directive breakdown. Each token is labelled by category — freshness, revalidation, audience, or other — and given a one-line description. The analyzer recognises the full common set, including:

  • max-age / s-maxage — freshness lifetime in seconds; s-maxage overrides max-age for CDNs and proxies only.
  • no-cache — the response may be stored but must be revalidated with the origin before reuse.
  • no-store — the response must never be cached anywhere; use it for sensitive data.
  • public / private — whether shared caches may store the response, or only the end user's browser.
  • must-revalidate / proxy-revalidate / immutable — control what happens once a response goes stale.
  • stale-while-revalidate / stale-if-error — serve a stale copy while refreshing in the background or when the origin errors.

Building a header from scratch

Switch to the Builder tab to assemble a header without memorising the syntax. Toggle the directives you want, type numeric values for max-age, s-maxage, stale-while-revalidate, and stale-if-error, and the tool writes the correct Cache-Control: string for you to copy. You can send the generated header straight to the Analyze tab to confirm it does what you intended before pasting it into your server config, CDN rules, or framework response.

The Analyze tab also includes ready-made patterns you can load with one click — fingerprinted static assets cached for a year with immutable, no-cache HTML, private user data, and a CDN setup using stale-while-revalidate.

Why cache headers matter

Getting Cache-Control right is one of the cheapest performance wins available: a correctly cached asset is served from the browser or a nearby CDN edge instead of making a full round-trip to your origin, which cuts load time and origin traffic. Getting it wrong is just as consequential in the other direction — too aggressive, and users keep seeing a stale page after you ship a fix; too loose, and you waste bandwidth re-sending files that never changed.

A common, safe baseline is to fingerprint static files (CSS, JS, images with a hash in the filename) and cache them with max-age=31536000, immutable for a full year, while serving HTML with no-cache so it is always revalidated and picks up new asset references immediately. Note that max-age is always expressed in seconds, so one year is 31,536,000 — a value the analyzer converts back into readable units so you can sanity-check it at a glance.

Paste a header above to decode it, or open the Builder to generate a fresh one.