plugin/cache: don't update freq is prefetch isn't used. (#1144)
Small optimization.
This commit is contained in:
parent
8ed730e1cb
commit
c7ff44fb3a
1 changed files with 3 additions and 1 deletions
4
plugin/cache/handler.go
vendored
4
plugin/cache/handler.go
vendored
|
@ -34,7 +34,9 @@ func (c *Cache) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
|
||||||
resp, _ = state.Scrub(resp)
|
resp, _ = state.Scrub(resp)
|
||||||
w.WriteMsg(resp)
|
w.WriteMsg(resp)
|
||||||
|
|
||||||
i.Freq.Update(c.duration, now)
|
if c.prefetch > 0 {
|
||||||
|
i.Freq.Update(c.duration, now)
|
||||||
|
}
|
||||||
|
|
||||||
pct := 100
|
pct := 100
|
||||||
if i.origTTL != 0 { // you'll never know
|
if i.origTTL != 0 { // you'll never know
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue