Skip to content

Commit

Permalink
use 200 as the default minimum size
Browse files Browse the repository at this point in the history
  • Loading branch information
CAFxX committed Jan 21, 2021
1 parent 04359cb commit 1028824
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ const (
type codings map[string]float64

const (
// DefaultMinSize is the default minimum size for which we enable compression.
// 20 is a very conservative default borrowed from nginx: you will probably want
// to measure if a higher minimum size improves performance for your workloads.
DefaultMinSize = 20
// DefaultMinSize is the default minimum response body size for which we enable compression.
//
// 200 is a somewhat arbitrary number; in experiments compressing short text/markup-like sequences
// with different compressors we saw that sequences shorter that ~180 the output generated by the
// compressor would sometime be larger than the input.
// In general there can be no one-size-fits-all value: you will want to measure if a different
// minimum size improves end-to-end performance for your workloads.
DefaultMinSize = 200
)

// Adapter returns a HTTP handler wrapping function (a.k.a. middleware)
Expand Down

0 comments on commit 1028824

Please sign in to comment.