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.
Why brotli was awesome?
Like gzip (well-known content-encoding), brotli was awesome (at the moment) and cloudflare was experiment with it. Based on personal test, brotli was optimized on dynamic content and specific mime-types (eg. text/html, application/json, and another dynamic content), but brotli still support another types (since they use
Static files (eg. jpeg, jpg, png, webp, gif, etc) aren’t optimized (maybe, not yet optimized by brotli?).
- 1 x Intel x3430
- 4 x 4GB DDR3 Memory
- 4 x 76GB SCSI/SAS Harddrive (RAID-10)
- Linux Cent OS 7 x86_64
- Nginx 1.11.4 + ngx_brotli module + http2 + openssl-1.0.2j (ALPN)
- google/brotli library
- Intel(R) Core(TM) i5-4200M
- 2 x 4GB DDR3 Memory
- 1 x 500GB 5400RPM SATA
- Google Chrome Version 53.0.2785.143 (64-bit)
gzip compression level: 6/9 (default 1)
brotli compression level: 9/11 (default 6)
Default Landing Pages Nginx (612bytes)
Dummy json file (9,5KBytes)
Brotli compression do better than gzip (on max compression level), but since brotli isn’t yet RFC Standards (still draft), I would not recommend deploy it on production state (but if you know and can handle the risk, it’s worthed). Unfortunately, brotli won’t work on HTTP connection (it means that you need TLS configuration on your webserver).
Brotli Library for Cent OS 7
You can use pre-compiled library for Cent OS 7 to install
ngx_brotli module for nginx.
Interesting to join the projects? :-)