mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -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:
@@ -383,7 +383,7 @@ func SOA(b ServiceBackend, zone string, state request.Request, opt Options) ([]d
|
||||
func BackendError(b ServiceBackend, zone string, rcode int, state request.Request, err error, opt Options) (int, error) {
|
||||
m := new(dns.Msg)
|
||||
m.SetRcode(state.Req, rcode)
|
||||
m.Authoritative, m.RecursionAvailable, m.Compress = true, true, true
|
||||
m.Authoritative, m.RecursionAvailable = true, true
|
||||
m.Ns, _ = SOA(b, zone, state, opt)
|
||||
|
||||
state.SizeAndDo(m)
|
||||
|
||||
Reference in New Issue
Block a user