• Miek Gieben's avatar
    Do Compress only when need in request.Scrub (#1760) · 57352924
    Miek Gieben authored
    * Remove Compress by default
    
    Set Compress = true in Scrub only when the message doesn not fit the
    advertized buffer. Doing compression is expensive, so try to avoid it.
    
    Master vs this branch
    pkg: github.com/coredns/coredns/plugin/cache
    BenchmarkCacheResponse-2   	   50000	     24774 ns/op
    
    pkg: github.com/coredns/coredns/plugin/cache
    BenchmarkCacheResponse-2   	  100000	     21960 ns/op
    
    * and make it compile
    57352924
reverse.go 2.41 KB