mirror of
https://github.com/coredns/coredns.git
synced 2025-11-02 02:03:13 -05:00
plugin/cache: Set min TTL default to zero (#2199)
* set min ttl default to zero * add short TTL test case
This commit is contained in:
4
plugin/cache/README.md
vendored
4
plugin/cache/README.md
vendored
@@ -41,10 +41,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, which can be useful to limit queries to the backend.
|
||||
**MINTTL** overrides the cache minimum TTL (default 0), 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, which can be useful to limit queries to the backend.
|
||||
**MINTTL** overrides the cache minimum TTL (default 0), 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.
|
||||
|
||||
4
plugin/cache/cache.go
vendored
4
plugin/cache/cache.go
vendored
@@ -239,9 +239,9 @@ func (w *ResponseWriter) Write(buf []byte) (int, error) {
|
||||
|
||||
const (
|
||||
maxTTL = dnsutil.MaximumDefaulTTL
|
||||
minTTL = dnsutil.MinimalDefaultTTL
|
||||
minTTL = 0
|
||||
maxNTTL = dnsutil.MaximumDefaulTTL / 2
|
||||
minNTTL = dnsutil.MinimalDefaultTTL
|
||||
minNTTL = 0
|
||||
|
||||
defaultCap = 10000 // default capacity of the cache.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user