Interactive Diagnostic

Cache-Control & ETag Validator

Evaluate HTTP response caching directives, inspect browser versus shared CDN lifetimes, and simulate conditional If-None-Match revalidation decisions (304 Not Modified vs 200 OK).

Zero-Log Guarantee: Runs 100% in your browser runtime. Header values, ETags, and API responses never leave your device.
Quick Presets:
Browser Cache Lifetime1 hourmax-age=3600s
Shared / CDN Lifetime1 day (24h)s-maxage=86400s
Revalidation PolicyBackground Refreshstale-while-revalidate=60s

Parsed Directives Breakdown

DirectiveValueScopeSemantic Meaning

Server & Client State

Prefix with W/ for weak validation (semantic equivalence).
The cached validator sent by browser on reload / navigation.

Server Evaluation Decision

304

HTTP 304 Not Modified

Zero payload transmitted • Cached representation is valid
The client validator If-None-Match matches the server's current ETag. The server instructs the browser to reuse its existing cached payload body.
Simulated HTTP Response Header Block:
HTTP/1.1 304 Not Modified
Date: Fri, 11 Sep 2026 12:00:00 GMT
ETag: W/"v1.4.2-hash998"
Cache-Control: no-cache
Connection: keep-alive
(Payload: 0 Bytes)

Core Principles of HTTP Caching (RFC 9111)

HTTP caching mechanisms optimize web performance by avoiding redundant network transmissions and reducing server load. Caching behavior is primarily governed by the Cache-Control header and conditional validation headers (ETag / If-None-Match).

1. 'no-cache' vs 'no-store'

no-cache does not mean "do not cache". It means the client may store the response, but must revalidate with the origin server via If-None-Match before using it.

no-store forbids all storage in volatile memory or disk. This is the only directive that guarantees zero caching.

2. Browser (max-age) vs CDN (s-maxage)

max-age specifies freshness for private user browser caches.

s-maxage specifically overrides max-age for shared intermediate caches (e.g. Cloudflare, CloudFront, NGINX), allowing long CDN caching with short browser caching.

3. Strong vs Weak ETag Validation

Strong ETags (e.g. "abc789") guarantee byte-for-byte binary identity.

Weak ETags (e.g. W/"xyz123") guarantee semantic equivalence (e.g. identical data with different compression or whitespace), which is fully valid for conditional 304 responses.

4. Modern Stale Directives

stale-while-revalidate allows clients to serve expired cached content instantly while fetching a fresh update in the background.

Frequently Asked Questions

Why does my browser still fetch assets when max-age is set?

Pressing F5 or clicking the browser refresh button sends an explicit Cache-Control: max-age=0 request header, forcing conditional revalidation. Adding the immutable directive instructs modern browsers to bypass revalidation even during user-initiated page refreshes.

How does HTTP 304 save bandwidth?

An HTTP 304 Not Modified response contains only HTTP headers and 0 bytes of payload body. For a 2MB JSON document, the payload size drops from 2,000,000 bytes to approximately 300 bytes of headers.