aboutsummaryrefslogtreecommitdiff
path: root/plugin/cache/handler.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/cache/handler.go')
-rw-r--r--plugin/cache/handler.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugin/cache/handler.go b/plugin/cache/handler.go
index f3f2e675b..b7824beba 100644
--- a/plugin/cache/handler.go
+++ b/plugin/cache/handler.go
@@ -34,7 +34,9 @@ func (c *Cache) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
resp, _ = state.Scrub(resp)
w.WriteMsg(resp)
- i.Freq.Update(c.duration, now)
+ if c.prefetch > 0 {
+ i.Freq.Update(c.duration, now)
+ }
pct := 100
if i.origTTL != 0 { // you'll never know