Run zstd before brotli if both are enabled#44
Run zstd before brotli if both are enabled#44kamermans wants to merge 1 commit intotokers:masterfrom
Conversation
|
@SuperSandro2000 you need this patch when u want brotli and zstd running at the same time. |
|
Hi there! Any news? |
|
Hi, last day i try to compile NGINX 1.29.1 with OpenSSL 3.5.2 and zstd-nginx-module, anyway sometimes NGINX respond using br compression instead zstd. I cannot understand why. When i test with command line curl like this : curl -sS --http2 -D - -o /dev/null -H 'Accept-Encoding: zstd, br, gzip' https://www.inventivashop.com | tr -d '\r' | grep -iE 'HTTP/|content-encoding|alt-svc|server' Response : HTTP/2 200 NGINX respond correctly using ALWAY zstd. When i use Chrome the 90% of test response in BR compression. I cannot understand why. |
Since Safari doesn't support zstd yet, I have to keep brotli enabled, however, this module is run after brotli, so if both are supported, brotli is used. This is a problem since all browsers that support zstd also support brotli, so zstd is never actually used.
This PR reorders the module/filter before brotli so it takes priority (since it's faster and the compression is better).
I took this patch from #40 by @mklooss (thanks!)