Everything, Everywhere
Verified Specification | Standardized Formulas | Instant Precision
Secure & Private (Zero Data Retention) Free Access • No Sign-Up
IETF RFC 9111 & RFC 9110 Zero External CDN In-Memory Simulator

HTTP Caching, ETag, Conditional Requests & RFC 9111 Architecture Studio

Architect, validate, and simulate production HTTP caching behavior under IETF RFC 9111 (obsoleting RFC 7234). Calculate response age with clock skew, evaluate strong vs weak ETag matching, test RFC 9110 Section 13 conditional request evaluation order (304 Not Modified vs 412 Precondition Failed), synthesize Cache-Control headers, and export battle-tested NGINX, Cloudflare Workers, and Go 1.23+ configurations.

FRESH
Cache Freshness State
12s
Calculated Current Age
300s
Freshness Lifetime
304 Not Mod
Conditional Response
99.4%
Bandwidth Saved

RFC 9111 Section 4.2 Age & Freshness Lifetime Algorithm

Configure timestamps, network round-trip delays, and response headers to trace the exact age mathematical calculation defined in RFC 9111 Section 4.2.3.

0s (Origin Emit) Freshness: 300s SWR: 900s Stale Expired
● Fresh (Cache HIT) ● Stale-While-Revalidate (Background Fetch) ● Stale (Must Revalidate / Error) ▲ Current Age Position

RFC 9111 Mathematical Trace

RFC 9110 Section 13 Conditional Preconditions Simulator

Test exact ETag matching semantics (strong vs weak) and simulate the RFC 9110 Section 13.2 precedence ladder across If-Match, If-Unmodified-Since, If-None-Match, If-Modified-Since, and If-Range.

1. Target Resource State on Origin

2. Incoming Client Request Headers

RFC 9110 SECTION 13.2 STEP-BY-STEP PRECEDENCE DECISION

Interactive RFC 9111 Cache-Control Header Synthesizer

Select battle-tested architecture presets or tailor every individual Cache-Control directive to prevent stale leaks, enforce revalidation, or lock CDN edge copies.

Shared caches (CDNs, forward proxies) may store even if authenticated.

Only the end-user browser may cache. CDNs and shared proxies MUST NOT store.

Strict ban on writing to disk or memory cache. Never persist.

May store, but MUST revalidate with origin (ETag/304) before serving.

Once expired, cache MUST NOT serve stale even during origin outage.

RFC 8246: Body never changes during max-age. Suppresses refresh 304s.

Cache-Control: public, max-age=31536000, immutable

Header Directives Semantic Analysis

Directive Applies To RFC 9111 Effect & Engine Behavior

Vary Header Fragmentation & Browser State Partitioning

Model how the Vary header splits cache entries into disparate variant buckets, and understand modern browser cache double-keying (RFC 9111 Section 4.1 + W3C Privacy Partitioning).

Production Server & Edge Caching Blueprints

Copy-pasteable, production-ready server and edge proxy configurations adhering strictly to RFC 9111.

RFC 9111 Critical Architecture Traps

Trap 1: The Weak ETag Range Request Trap If an origin emits a weak ETag (W/"xyz") and a client issues an HTTP Range request with If-Range: W/"xyz", RFC 9110 explicitly dictates that weak comparison is invalid for Range requests! The server will ignore the condition and stream the entire 200 OK file rather than 206 Partial Content, causing video players and audio streaming clients to stutter and waste gigabytes of bandwidth.
Trap 2: Neglecting s-maxage on CDN Cached API Endpoints Setting Cache-Control: public, max-age=3600 on an API endpoint causes both the CDN edge AND all end-user browsers to cache responses for 1 hour. If you push an urgent bugfix, you can purge the CDN cache in 150ms, but user browsers will continue executing stale code until their private 1-hour timer elapses. Always separate them: Cache-Control: public, max-age=0, s-maxage=3600, must-revalidate.
Trap 3: Emitting Vary: User-Agent or Vary: Cookie Because every device, browser build, and user session produces unique header values, placing Vary: User-Agent or Vary: Cookie on a cacheable asset fractures the CDN cache into tens of thousands of isolated variants. The CDN Cache Hit Ratio drops from 98% to under 2%, effectively turning the CDN into an expensive, high-latency forward proxy.
Trap 4: Missing immutable on Content-Hashed Bundles When modern users reload a web page (Cmd+R or F5), browsers automatically dispatch conditional revalidation requests (If-None-Match) for every single JS/CSS bundle, even if max-age=31536000 is set. Adding immutable (RFC 8246) informs the browser that the file contents will never change, completely eliminating 50+ network round-trips on every page refresh.

Frequently Asked Technical Questions

What is the exact difference between RFC 9111 and the older RFC 7234 or RFC 2616 specifications?+
Published in June 2022 as part of the core HTTP specification revision, RFC 9111 obsoleted RFC 7234 (and RFC 2616 before that). RFC 9111 formalizes modern caching behavior including the formal integration of stale-while-revalidate (RFC 5861), stale-if-error, immutable (RFC 8246), and must-understand directives. It clarifies the exact mathematical algorithms for calculating response age across clocks with skew, removes deprecated warnings, tightens heuristic freshness calculations, and standardizes how intermediate shared caches (CDNs, forward proxies) must handle status codes and Range requests.
How does RFC 9111 calculate current age and freshness lifetime in the presence of clock skew?+
A cache calculates current age through four distinct variables: apparent_age = max(0, response_time - date_value); response_delay = response_time - request_time; corrected_age_value = age_value + response_delay; corrected_initial_age = max(apparent_age, corrected_age_value); resident_time = now - response_time; and current_age = corrected_initial_age + resident_time. If current_age < freshness_lifetime (derived from s-maxage in shared caches, or max-age, or Expires - Date), the response is fresh and served directly from cache without contacting the origin server.
What is the distinction between strong and weak ETags, and when is each permitted?+
A strong entity tag (e.g. "33a64df5") guarantees octet-for-octet byte equivalence. It changes whenever any byte of the representation changes, making it mandatory for sub-range requests (Range: bytes=0-1024 with If-Range) to prevent corruption from spliced content. A weak entity tag (prefixed with W/, e.g. W/"33a64df5") indicates semantic equivalence—the resource is functionally identical for caching purposes even if byte representation differs (e.g. Gzip vs Brotli compression, or reordered JSON keys). RFC 9110 and RFC 9111 explicitly permit weak ETags for If-None-Match conditional validation (resulting in 304 Not Modified), but forbid weak ETags for state-changing preconditions (If-Match on PUT or PATCH) to prevent lost updates.
What is the exact evaluation order when both If-Match, If-None-Match, If-Modified-Since, and If-Unmodified-Since are present?+
RFC 9110 Section 13.2 defines strict precedence: (1) If If-Match is present and does not match the target ETag, return 412 Precondition Failed immediately. (2) Else if If-Unmodified-Since is present and the resource has been modified after that date, return 412. (3) Else if If-None-Match is present, evaluate it using weak or strong matching depending on the method: if any tag matches, return 304 Not Modified for GET/HEAD, or 412 for state-changing methods. When If-None-Match is present, If-Modified-Since MUST be ignored by compliant caches. (4) Else if If-Modified-Since is present (only for GET/HEAD without If-None-Match), if the resource has not been modified since that timestamp, return 304 Not Modified.
Why does Cache-Control: no-cache NOT mean do not cache?+
One of the most pervasive misconceptions in web engineering is confusing no-cache with no-store. Cache-Control: no-cache instructs the cache that it MAY store the response in memory or disk, but it MUST revalidate the cached copy with the origin server (using ETag or Last-Modified conditional headers) before serving it to any request. If the origin returns 304 Not Modified, the cache serves the stored copy without transferring the body. In contrast, Cache-Control: no-store strictly forbids the cache from persisting any portion of the request or response to volatile or non-volatile storage, which is required for highly sensitive personal data, PCI/HIPAA secrets, and single-use tokens.
How does Browser Cache Partitioning (State Partitioning) impact HTTP caching across third-party domains?+
Historically, browser HTTP caches used a single cache key: (HTTP method, URL). If site A loaded a shared library from cdn.example.com/lib.js, site B could load it from the browser cache with zero network latency. However, this enabled cross-site user tracking, XS-Leaks, and timing attacks. Modern browsers (Chrome, Firefox, Safari) enforce double-keyed or triple-keyed cache partitioning: the cache key is now (Top-Level Site, Frame Origin, URL). Consequently, an asset cached by site A cannot be shared by site B even if they request the exact same URL with identical Cache-Control headers.
Sponsored Utility
While You're Here
Sponsored Recommendations
Advertisement