You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<div><a class="anchor" name="cache"></a><a class="anchor" name="6-cache"></a><a class="anchor" name="6.2.1-cache"></a><a class="anchor" name="cache (Cache)"></a><a class="anchor" name="cache (Cache section)"></a><div class="keyword"><b><a class="anchor" name="cache"></a><a href="#6.2.1-cache">cache</a></b> <span style="color: #080"><name></span></div><pre class="text">Declare a cache section, allocate a shared cache memory named <name>, the
24504
24514
size of cache is mandatory (see keyword "<a href="#total-max-size">total-max-size</a>" below).
24515
+
</pre><a class="anchor" name="early-hints"></a><a class="anchor" name="6-early-hints"></a><a class="anchor" name="6.2.1-early-hints"></a><a class="anchor" name="early-hints (Cache)"></a><a class="anchor" name="early-hints (Cache section)"></a><div class="keyword"><b><a class="anchor" name="early-hints"></a><a href="#6.2.1-early-hints">early-hints</a></b> <span style="color: #080"><on/off/only></span> <span style="color: #008">[ratio <span style="color: #080"><integer></span>]</span></div><pre class="text">Enable or disable support for HTTP 103 Early Hints responses (see RFC 8297).
24516
+
When enabled, the cache remembers relevant "Link" response headers (with a
24517
+
"rel" parameter of preload, preconnect, dns-prefetch, modulepreload or
24518
+
prefetch) seen on cached responses. When a subsequent "<a href="#cache-use">cache-use</a>" lookup
24519
+
cannot serve the full response from the cache but the URL's "Link" hints
24520
+
are still known, the cache emits a 103 Early Hints response carrying those
24521
+
hints before forwarding the request to the backend, giving the client a
24522
+
head start on fetching subresources while the backend produces the body.
24523
+
Individual "<a href="#cache-use">cache-use</a>" rules may opt out of this behavior with the
24524
+
"no-early-hints" keyword. The default value is off (disabled).
24525
+
24526
+
When "<a href="#early-hints">early-hints</a>" is set to "only", no responses are stored in the cache.
24527
+
Instead, if a backend response contains relevant "Link" headers as defined
24528
+
above, the cache stores those in order to emit a 103 Early Hints response if
24529
+
that same URL is accessed later. Since the response body is never stored in
24530
+
this mode, the "<a href="#max-object-size">max-object-size</a>" limit does not apply: hints are extracted
24531
+
and stored regardless of the response's size.
24532
+
24533
+
The optional "ratio" argument sets the percentage of total cache blocks
24534
+
that may be reserved for hints-only entries (1 to 99, default 25). Higher
24535
+
values keep hints alive longer at the cost of less space for full responses;
24536
+
lower values prioritize full responses. This argument only makes sense when
24537
+
"<a href="#early-hints">early-hints</a>" is set to on, and is ignored otherwise. In "only" mode every
24538
+
stored entry is a hints entry, so the whole cache is available to them and
24539
+
this ratio has no practical effect.
24505
24540
</pre><a class="anchor" name="max-age"></a><a class="anchor" name="6-max-age"></a><a class="anchor" name="6.2.1-max-age"></a><a class="anchor" name="max-age (Cache)"></a><a class="anchor" name="max-age (Cache section)"></a><div class="keyword"><b><a class="anchor" name="max-age"></a><a href="#6.2.1-max-age">max-age</a></b> <span style="color: #080"><seconds></span></div><pre class="text">Define the maximum expiration duration. The expiration is set as the lowest
24506
24541
value between the s-maxage or max-age (in this order) directive in the
24507
24542
Cache-Control response header and this value. The default value is 60
0 commit comments