diff --git a/adapter.go b/adapter.go index 04b643b..8b455fc 100644 --- a/adapter.go +++ b/adapter.go @@ -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)