Declare a cache section, allocate a shared cache memory named <name>, the
size of cache is mandatory (see keyword "total-max-size" below).
+early-hints <on/off>
+ Enable or disable support for HTTP 103 Early Hints responses (see RFC 8297).
+ When enabled, the cache remembers relevant "Link" response headers (with a
+ "rel" parameter of preload, preconnect, dns-prefetch, modulepreload or
+ prefetch) seen on cached responses. When a subsequent "cache-use" lookup
+ cannot serve the full response from the cache but the URL's "Link" hints
+ are still known, the cache emits a 103 Early Hints response carrying those
+ hints before forwarding the request to the backend, giving the client a
+ head start on fetching subresources while the backend produces the body. The
+ default value is off (disabled).
+
max-age <seconds>
Define the maximum expiration duration. The expiration is set as the lowest
value between the s-maxage or max-age (in this order) directive in the
/* Flags for configuration. */
#define CACHE_CF_VARY_PROCESSING 0x00000001 /* manage Vary header (disabled by default) */
+#define CACHE_CF_EARLY_HINTS 0x00000002 /* enable HTTP 103 Early Hints (disabled by default) */
static uint64_t cache_hash_seed = 0;
file, linenum, args[0]);
err_code |= ERR_WARN;
}
+ } else if (strcmp(args[0], "early-hints") == 0) {
+ if (alertif_too_many_args(1, file, linenum, args, &err_code)) {
+ err_code |= ERR_ABORT;
+ goto out;
+ }
+
+ if (strcmp(args[1], "on") == 0) {
+ tmp_cache_config->flags |= CACHE_CF_EARLY_HINTS;
+ } else if (strcmp(args[1], "off") == 0) {
+ tmp_cache_config->flags &= ~CACHE_CF_EARLY_HINTS;
+ } else {
+ ha_warning("parsing [%s:%d]: '%s' expects \"on\" or \"off\" (enable or disable HTTP 103 Early Hints support).\n",
+ file, linenum, args[0]);
+ err_code |= ERR_WARN;
+ }
} else if (strcmp(args[0], "max-secondary-entries") == 0) {
unsigned int max_sec_entries;
char *err;