PhoenixBakery.Brotli (phoenix_bakery v0.1.0) View Source
Brotli is algorithm that offers better compression ratio when compared with Gzip, but at the cost of greater memory consumption during compression. It provides quite good decompression speed. It is supported by all major modern browsers
Requirements
To use PhoenixBakery.Brotli you need at least one of:
- Add
{:brotli, ">= 0.0.0", runtime: false}to use NIF version of the Brotli compressor. It requires C code compilation and it can slow down compilation a little as the compilation isn't the fastest. - Have
brotliutility available in$PATHor configured viaconfig :phoenix_bakery, :brotli, "/path/to/brotli"
If none of the above is true then compressor will raise.
Configuration
config :phoenix_bakery,
brotli_opts: %{
quality: 5 # defaults to: `11` (max)
}