W3 total cache with NGINX and HTTP/3
-
Hi there,
thanks for your excellent work and this fantastic plugin.
There is a problem if using W3 with HTTP/3: there is no HTTP_HOST variable for nginx or in other words, there won’t be a HOST header in the request.
With this, your plugin will generate a page_enhanced cache file for H2, and another one for H3… difference is just the non-existence of the “HOST” domain…
- page_enhanced/URL -> for HTTP3
- page_enhanced/HTTP_HOST/URL -> for HTTP2 and others
It is a problem with W3 cache using HTTP/3, since with a HTTP3 configuration, there will be always browsers and bots asking for HTTP/2 also, of course, and there is going to be two different cache paths, one for each protocol.
It is possible to pass HOST variable to fastcgi (php) with HTTP3 using $host (nginx internal) instead of $http_host (header) and everything will be ok….
But if I do this way, your nginx.conf rules won’t run since they are checking files and rewriting by using $http_host variable, which is going to be empty, so will look for “page_enhanced/URL” and it won’t exist.
A suggestion could be for you to use $host variable in the nginx.conf rules for everything, and let user pass $host to php through fastcgi params… but we may consider $host variable won’t include TCP port….
With HTTP/3, nginx admins are almost forced to use $host instead of $http_host everywhere, since there won’t be a Host header, but a authority header….
Regards
Gino
- The topic ‘W3 total cache with NGINX and HTTP/3’ is closed to new replies.