aboutsummaryrefslogtreecommitdiff
path: root/plugin/cache/cache.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/cache/cache.go')
-rw-r--r--plugin/cache/cache.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugin/cache/cache.go b/plugin/cache/cache.go
index ed39fee86..c46267658 100644
--- a/plugin/cache/cache.go
+++ b/plugin/cache/cache.go
@@ -9,6 +9,7 @@ import (
"github.com/coredns/coredns/plugin"
"github.com/coredns/coredns/plugin/pkg/cache"
+ "github.com/coredns/coredns/plugin/pkg/dnsutil"
"github.com/coredns/coredns/plugin/pkg/response"
"github.com/coredns/coredns/request"
@@ -158,7 +159,7 @@ func (w *ResponseWriter) WriteMsg(res *dns.Msg) error {
duration = w.nttl
}
- msgTTL := minMsgTTL(res, mt)
+ msgTTL := dnsutil.MinimalTTL(res, mt)
if msgTTL < duration {
duration = msgTTL
}
@@ -226,9 +227,8 @@ func (w *ResponseWriter) Write(buf []byte) (int, error) {
}
const (
- maxTTL = 1 * time.Hour
- maxNTTL = 30 * time.Minute
- failSafeTTL = 5 * time.Second
+ maxTTL = dnsutil.MaximumDefaulTTL
+ maxNTTL = dnsutil.MaximumDefaulTTL / 2
defaultCap = 10000 // default capacity of the cache.