sozu-proxy / sozu

Sōzu HTTP reverse proxy, configurable at runtime, fast and safe, built in Rust. It is awesome!
https://www.sozu.io/
GNU Affero General Public License v3.0
3.14k stars 195 forks source link

Brotli support #572

Open TBK opened 5 years ago

TBK commented 5 years ago

Intro Brotli is a data format specification[1] for data streams compressed with a specific combination of the general-purpose LZ77 lossless compression algorithm, Huffman coding and 2nd order context modelling. Brotli was initially developed to decrease the size of transmissions of WOFF2 web fonts, and in that context was a continuation of the development of zopfli, which is a zlib-compatible implementation of the standard gzip and deflate specifications. Brotli allows a denser packing than gzip and deflate because of several algorithmic and format level improvements: the use of context models for literals and copy distances, describing copy distances through past distances, use of move-to-front queue in entropy code selection, joint-entropy coding of literal and copy lengths, the use of graph algorithms in block splitting, and a larger backward reference window are example improvements. The Brotli specification was generalized in September 2015 for HTTP stream compression (content-encoding type 'br'), and can now be used to encode any data sent by a web server to a web browser if both client and server support the format. This generalized iteration also improved the compression ratio by using a pre-defined dictionary of frequently used words and phrases.

Source: https://en.wikipedia.org/wiki/Brotli

Additional info "Original project": https://github.com/google/brotli RFC: https://tools.ietf.org/html/rfc7932 Rust implementation by Dropbox: https://github.com/dropbox/rust-brotli Dropbox blog post: https://blogs.dropbox.com/tech/2016/06/lossless-compression-with-brotli/

Geal commented 5 years ago

sozu does not support compression as of now, although that might be interesting in the future. How would you plan to do it?