Mar 102017

Brotli compression improves website performance by offering approximately 20% better compression than existing algorithms such as GZIP.

Brotli is a generic-purpose lossless compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd order context modeling, with a compression ratio comparable to the best currently available general-purpose compression methods. It is similar in speed with deflate but offers more dense compression.

When brotli is enabled, it takes precendence over gzip if Accept-Encoding has both gzip and brotli.

Nginx source tarball:

# wget
# tar -xzvf nginx-1.10.3.tar.gz

Brotli git clone:

# cd /usr/local/src
# git clone
# cd ngx_brotli
# git submodule update --init --recursive

Nginx reverse proxy build:

# ./configure --http-client-body-temp-path=/usr/local/src/nginx-1.10.3/tmp/body \
--http-fastcgi-temp-path=/usr/local/src/nginx-1.10.3/tmp/fastcgi \
--http-proxy-temp-path=/usr/local/src/nginx-1.10.3/tmp/proxy \
--lock-path=/var/lock/subsys/nginx \
--pid-path=/var/run/ \
--user=nginx --group=nginx \
--without-mail_pop3_module --without-mail_smtp_module \
--without-mail_imap_module --without-http_uwsgi_module \
--without-http_scgi_module \
--add-module=/usr/local/src/ngx_brotli --prefix=/usr/local/src/nginx-1.10.3

Nginx reverse proxy configuration:

http {
  brotli on;
# brotli_static on;
  brotli_comp_level 4;
# brotli_types *;



© 2011 Indimon Internet Services

Site last updated April 23, 2022 @ 10:45 am

Return to Top ▲Return to Top ▲