aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorGravatar Chris O'Haver <cohaver@infoblox.com> 2018-10-22 16:59:12 -0400
committerGravatar GitHub <noreply@github.com> 2018-10-22 16:59:12 -0400
commit96529b2c501b47a71a0f6eae5a04ebe86ba1ab1d (patch)
tree053f7e923df69c43c531dd3c3977eb743a560daf /plugin
parent85e5ab77d65d224e2c2e5a31e28f17595fea6848 (diff)
downloadcoredns-96529b2c501b47a71a0f6eae5a04ebe86ba1ab1d.tar.gz
coredns-96529b2c501b47a71a0f6eae5a04ebe86ba1ab1d.tar.zst
coredns-96529b2c501b47a71a0f6eae5a04ebe86ba1ab1d.zip
make default min ttl 5 (#2227)
Diffstat (limited to 'plugin')
-rw-r--r--plugin/cache/README.md4
-rw-r--r--plugin/cache/cache.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/plugin/cache/README.md b/plugin/cache/README.md
index de0e5da4b..fcff72c58 100644
--- a/plugin/cache/README.md
+++ b/plugin/cache/README.md
@@ -40,10 +40,10 @@ cache [TTL] [ZONES...] {
* **TTL** and **ZONES** as above.
* `success`, override the settings for caching successful responses. **CAPACITY** indicates the maximum
number of packets we cache before we start evicting (*randomly*). **TTL** overrides the cache maximum TTL.
- **MINTTL** overrides the cache minimum TTL (default 0), which can be useful to limit queries to the backend.
+ **MINTTL** overrides the cache minimum TTL (default 5), which can be useful to limit queries to the backend.
* `denial`, override the settings for caching denial of existence responses. **CAPACITY** indicates the maximum
number of packets we cache before we start evicting (LRU). **TTL** overrides the cache maximum TTL.
- **MINTTL** overrides the cache minimum TTL (default 0), which can be useful to limit queries to the backend.
+ **MINTTL** overrides the cache minimum TTL (default 5), which can be useful to limit queries to the backend.
There is a third category (`error`) but those responses are never cached.
* `prefetch` will prefetch popular items when they are about to be expunged from the cache.
Popular means **AMOUNT** queries have been seen with no gaps of **DURATION** or more between them.
diff --git a/plugin/cache/cache.go b/plugin/cache/cache.go
index 4b6cb4101..9ff43dac2 100644
--- a/plugin/cache/cache.go
+++ b/plugin/cache/cache.go
@@ -239,9 +239,9 @@ func (w *ResponseWriter) Write(buf []byte) (int, error) {
const (
maxTTL = dnsutil.MaximumDefaulTTL
- minTTL = 0
+ minTTL = dnsutil.MinimalDefaultTTL
maxNTTL = dnsutil.MaximumDefaulTTL / 2
- minNTTL = 0
+ minNTTL = dnsutil.MinimalDefaultTTL
defaultCap = 10000 // default capacity of the cache.