Skip to content

Commit b0b7293

Browse files
authored
Early Hints
1 parent d94ee1f commit b0b7293

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

config/etc/nginx/globals/map-cache.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ map $http_x_requested_with $es_http_x_request_with {
124124
"XMLHttpRequest" 1;
125125
}
126126

127+
# Early Hints pass-through gate
128+
# Only enable for top-level navigations on HTTP/2 or HTTP/3 clients.
129+
map $http_sec_fetch_mode $es_early_hints {
130+
default "";
131+
navigate $http2$http3;
132+
}
133+
127134
# X-Cache-Enabled Header Maps for WordPress Site Health - DISABLED FOR TESTING
128135
#map $upstream_cache_status $header_x_cache_enabled {
129136
# default true;

config/etc/nginx/globals/php-fpm.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ if ($skip_cache = 0 ) {
2424
# HTTP Reponse Headers
2525
include /etc/nginx/globals/response-headers.conf;
2626

27+
# Pass upstream 103 Early Hints only for eligible clients.
28+
early_hints $es_early_hints;
29+
2730
# Include FastCGI Configuration
2831
include /etc/nginx/globals/fastcgi-modified.conf;
2932
fastcgi_index index.php;

0 commit comments

Comments
 (0)