http-brotli #

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 wi

Source: upstream source

Read more: deep-dive article on deb.myguard.nl

Directives

brotli #

syntax: brotli on|off  ·  default: off  ·  context: http, server, location, if

Enables or disables on-the-fly compression of responses.

brotli_buffers #

syntax: brotli_buffers <number> <size>  ·  default: 32 4k|16 8k  ·  context: http, server, location

Deprecated, ignored.

brotli_comp_level #

syntax: brotli_comp_level <level>  ·  default: 6  ·  context: http, server, location

Sets on-the-fly compression Brotli quality (compression) level. Acceptable values are in the range from 0 to 11.

brotli_min_length #

syntax: brotli_min_length <length>  ·  default: 20  ·  context: http, server, location

Sets the minimum length of a response that will be compressed. The length is determined only from the Content-Length response header field.

brotli_static #

syntax: brotli_static on|off|always  ·  default: off  ·  context: http, server, location

Enables or disables checking of the existence of pre-compressed files with.br extension. With the always value, pre-compressed file is used in all cases, without checking if the client supports it.

brotli_types #

syntax: brotli_types <mime_type> [..]  ·  default: text/html  ·  context: http, server, location

Enables on-the-fly compression of responses for the specified MIME types in addition to text/html. The special value * matches any MIME type. Responses with the text/html MIME type are always compressed.

brotli_window #

syntax: brotli_window <size>  ·  default: 512k  ·  context: http, server, location

Sets Brotli window size. Acceptable values are 1k, 2k, 4k, 8k, 16k, 32k, 64k, 128k, 256k, 512k, 1m, 2m, 4m, 8m and 16m.

Example

brotli on;
brotli_comp_level 6;
brotli_static on;
brotli_types application/atom+xml application/javascript application/json application/vnd.api+json application/rss+xml
             application/vnd.ms-fontobject application/x-font-opentype application/x-font-truetype
             application/x-font-ttf application/x-javascript application/xhtml+xml application/xml
             font/eot font/opentype font/otf font/truetype image/svg+xml image/vnd.microsoft.icon
             image/x-icon image/x-win-bitmap text/css text/javascript text/plain text/xml;

↑ back to index