add brotli-min-length configuration option (#7854)

* add `brotli-min-length` configuration option

* add e2e tests for brotli

* include check for expected content type

* fix header and format
This commit is contained in:
Rahil Patel 2021-11-02 07:52:59 -04:00 committed by GitHub
parent ed34f6c93d
commit c8ab4dc307
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 84 additions and 0 deletions

View file

@ -413,6 +413,9 @@ type Configuration struct {
// Brotli Compression Level that will be used
BrotliLevel int `json:"brotli-level,omitempty"`
// Minimum length of responses, in bytes, that will be eligible for brotli compression
BrotliMinLength int `json:"brotli-min-length,omitempty"`
// MIME Types that will be compressed on-the-fly using Brotli module
BrotliTypes string `json:"brotli-types,omitempty"`
@ -778,6 +781,7 @@ func NewDefault() Configuration {
BlockUserAgents: defBlockEntity,
BlockReferers: defBlockEntity,
BrotliLevel: 4,
BrotliMinLength: 20,
BrotliTypes: brotliTypes,
ClientHeaderBufferSize: "1k",
ClientHeaderTimeout: 60,