Gzip

    Attention

    The window bits is a number that tells the compressor how far ahead in the text the algorithm should be looking for repeated sequence of characters. Due to a known bug in the underlying zlib library, window bits with value eight does not work as expected. Therefore any number below that will be automatically set to 9. This issue might be solved in future releases of the library.

    gzip.filter_enabled

    The % of requests for which the filter is enabled. Default is 100.

    By default compression will be skipped when:

    • A request includes accept-encoding header, but it does not contain “gzip” or “*”.
    • A request includes accept-encoding with “gzip” or “*” with the weight “q=0”. Note that the “gzip” will have a higher weight then “*”. For example, if accept-encoding is “gzip;q=0,*;q=1”, the filter will not compress. But if the header is set to “*;q=0,gzip;q=1”, the filter will compress.
    • A request whose accept-encoding header includes “identity”.
    • A response contains a content-encoding header.
    • A response contains a cache-control header whose value includes “no-transform”.
    • A response does not contain a content-type value that matches one of the selected mime-types, which default to application/javascript, application/json, application/xhtml+xml, image/svg+xml, text/css, text/html, text/plain, text/xml.
    • Neither content-length nor transfer-encoding headers are present in the response.
    • Response size is smaller than 30 bytes (only applicable when transfer-encoding is not chuncked).

    When compression is applied:

    • The content-length is removed from response headers.
    • Response headers contain “transfer-encoding: chunked” and “content-encoding: gzip”.