mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
Do Compress only when need in request.Scrub (#1760)
* 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
This commit is contained in:
1
plugin/cache/item.go
vendored
1
plugin/cache/item.go
vendored
@@ -61,7 +61,6 @@ func (i *item) toMsg(m *dns.Msg, now time.Time) *dns.Msg {
|
||||
m1.AuthenticatedData = i.AuthenticatedData
|
||||
m1.RecursionAvailable = i.RecursionAvailable
|
||||
m1.Rcode = i.Rcode
|
||||
m1.Compress = true
|
||||
|
||||
m1.Answer = make([]dns.RR, len(i.Answer))
|
||||
m1.Ns = make([]dns.RR, len(i.Ns))
|
||||
|
||||
Reference in New Issue
Block a user