h5bp / server-configs-nginx

Nginx HTTP server boilerplate configs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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).

commented

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:

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.

# This should be turned on if you are going to have pre-compressed copies (.gz) of
# static files available. If not it should be left off as it will cause extra I/O
# for the check. It is best if you enable this in a location{} block for
# a specific directory, or on an individual server{} level.
# gzip_static on;