Commit c7ff44fb authored by Miek Gieben's avatar Miek Gieben Committed by GitHub

plugin/cache: don't update freq is prefetch isn't used. (#1144)

Small optimization.
parent 8ed730e1
...@@ -34,7 +34,9 @@ func (c *Cache) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) ...@@ -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)
if c.prefetch > 0 {
i.Freq.Update(c.duration, now) 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment