mirror of
https://github.com/coredns/coredns.git
synced 2025-12-07 02:45:11 -05:00
middleware/cache: cache 0 will be capped at 5 (#408)
* middleware/cache: cache 0 will be capped at 5 cache 0 would return TTL=0 records, up that to the documented minimum of 5 seconds. * middleware/cache: check for 0 TTL Handle 0 TTL differently and return an error, we might need to special case this in the future.
This commit is contained in:
3
middleware/cache/cache.go
vendored
3
middleware/cache/cache.go
vendored
@@ -125,7 +125,8 @@ func (c *ResponseWriter) Write(buf []byte) (int, error) {
|
||||
const (
|
||||
maxTTL = 1 * time.Hour
|
||||
maxNTTL = 30 * time.Minute
|
||||
minTTL = 5 * time.Second
|
||||
|
||||
minTTL = 5 // seconds
|
||||
|
||||
defaultCap = 10000 // default capacity of the cache.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user