Opened 5 years ago

Last modified 6 months ago

#798 new enhancement

Implement http_brotli_static module

Reported by: bayden@… Owned by:
Priority: major Milestone:
Component: nginx-core Version: 1.9.x
Keywords: Cc:
uname -a:
nginx -V: 1.9.5

Description

Today, nginx supports the http_gzip_static module (http://nginx.org/en/docs/http/ngx_http_gzip_static_module.html) for doing ahead-of-time gzip compression of assets; this is very useful because it allows using high-ratio/low-performance compressors like Zopfli.

Web Browsers (Chrome and Firefox, to start) are about to start supporting a new Content-Encoding, named Brotli, which offers MUCH improved compression ratios but with slow performance. http://textslashplain.com/2015/09/10/brotli/ As such, we need nginx to support a similar module (e.g. http_brotli_static) for this new content-encoding.

Attachments (1)

brotli_1_11_10.patch (9.6 KB ) - added by eustas@… 4 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by bayden@…, 5 years ago

It appears that Google has made this issue rather moot by releasing a module that handles both static and on-the-fly Brotli compression: https://github.com/google/ngx_brotli

comment:2 by Steffen Weber, 5 years ago

Firefox 44 (scheduled for release in January 2016) will support Brotli: https://bugzilla.mozilla.org/show_bug.cgi?id=366559

It would be nice to have Brotli support available in nginx out-of-the-box. For me personally, the "brotli_static" feature mentioned in this bug report would be fine, I don't (yet) need on-the-fly Brotli compression.

Maybe this can be considered for the 1.9 branch?

Thank you for nginx!

comment:3 by lewisgoddard@…, 5 years ago

Just to add a few more relevant links:

comment:4 by cmoeke@…, 4 years ago

The Google Brotli module should be added now to nginx.

Most modern browsers support Brotli (http://caniuse.com/#feat=brotli):

  • Edge 15 (Current version 14)
  • Firefox 44 (Current version 50)
  • Chrome 50 (Current version 55)
  • Opera 38 (Current version 42)

There is also a fallback to gzip for older Browsers.

comment:5 by eustas@…, 4 years ago

An alternative could be to extend http_gzip_static module, because modules share 99% of logic.

http://mailman.nginx.org/pipermail/nginx-devel/2017-February/009536.html

Last edited 4 years ago by eustas@… (previous) (diff)

by eustas@…, 4 years ago

Attachment: brotli_1_11_10.patch added

comment:6 by marbacz@…, 3 years ago

What needs to be done to get the attached patch merged? The https://github.com/google/ngx_brotli module is apparently abandoned with the latest commit a year ago.

comment:7 by ai@…, 12 months ago

Right now all major browsers support Brotli including Safari.

https://github.com/google/ngx_brotli is live again, but this third-party module is not a good solution since the official nginx Docker image accepts only official modules (see https://github.com/nginxinc/docker-nginx/issues/371).

Can we do something to add Brotli to the list of official modules to have a good Docker image with nginx and Brotli, since it is pretty important for web performance?

comment:8 by Maxim Dounin, 6 months ago

See also #1961.

Note: See TracTickets for help on using tickets.