Add brotli in compression.conf
Birthright50 opened this issue · comments
It may be worth adding brotli compression, many browsers support this feature.
The option can be optional and commented out by default. (Not all nginx compiled with this module).
I think this would be a good addition, but it should definitely be disabled by default. If I'm not mistaken, there is no official brotli module for Nginx and the official Google module is no longer maintained. This is the most maintained fork of the official Google module: https://github.com/eustas/ngx_brotli
Regarding brotli_comp_level
I believe 4 or 5 would be a good value. See https://blogs.akamai.com/2016/02/understanding-brotlis-potential.html
Thanks for this suggestion @Birthright50 👍
That said:
-
Not all nginx compiled with this module
there is no official brotli module for Nginx
That the main point. We try to keep our configs compatible with the majority.
-
You should prefer using precompressed files instead of on-the-fly compression. (see h5bp/server-configs-apache#105 (comment))
And when using precompressed files, only one directive is needed with
ngx_brotli
:brotli_static on;
We can certainly add that brotli_static
line commented out like the gzip_static
one, but I'm not sure it's worth it given the hard conditions.
In other words, we will accept PR with brotli_static
addition, but I'm closing this issue since Nginx is not fully compatible with brotli compression right now.
server-configs-nginx/h5bp/web_performance/compression.conf
Lines 67 to 71 in 28874c3