aboutsummaryrefslogtreecommitdiff
path: root/plugin/cache/cache.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2018-02-17 19:45:52 +0100
committerGravatar GitHub <noreply@github.com> 2018-02-17 19:45:52 +0100
commit8cce06cba10c42ce501a57bd3b7d06ca6064d774 (patch)
tree8b5058915fe0dc06580c1a81a3f795449e17a508 /plugin/cache/cache.go
parent9719a47c1bc0bf0098ee07fd004e4d2d2ee139d9 (diff)
downloadcoredns-8cce06cba10c42ce501a57bd3b7d06ca6064d774.tar.gz
coredns-8cce06cba10c42ce501a57bd3b7d06ca6064d774.tar.zst
coredns-8cce06cba10c42ce501a57bd3b7d06ca6064d774.zip
Type.extra (#1538)
* Revert "pkg/typify: empty messages are OtherError (#1531)" This reverts commit fc1d73ffa9ae193c4cfca4adc194ae43f9360dbb. * plugin/cache: add failsafeTTL If we can not see what TTL we should put on a message to be cached, use 5 seconds as minimal TTL. We used to apply the maximum TTL to these messages.
Diffstat (limited to 'plugin/cache/cache.go')
-rw-r--r--plugin/cache/cache.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugin/cache/cache.go b/plugin/cache/cache.go
index 2967e1b34..a8776afac 100644
--- a/plugin/cache/cache.go
+++ b/plugin/cache/cache.go
@@ -171,7 +171,7 @@ func (w *ResponseWriter) set(m *dns.Msg, key int, mt response.Type, duration tim
case response.OtherError:
// don't cache these
default:
- log.Printf("[WARNING] Caching called with unknown typification: %d", mt)
+ log.Printf("[WARNING] Caching called with unknown classification: %d", mt)
}
}
@@ -186,8 +186,9 @@ func (w *ResponseWriter) Write(buf []byte) (int, error) {
}
const (
- maxTTL = 1 * time.Hour
- maxNTTL = 30 * time.Minute
+ maxTTL = 1 * time.Hour
+ maxNTTL = 30 * time.Minute
+ failSafeTTL = 5 * time.Second
defaultCap = 10000 // default capacity of the cache.