mirror of
https://github.com/coredns/coredns.git
synced 2025-11-02 02:03:13 -05:00
Remove TTL ceiling at 5s in plugin/cache (#1380)
The cache plugin always returned a minimum TTL of 5 seconds, regardless of the actual TTL of the records. A cache is not authoritative for the record TTL and should not extend it.
This commit is contained in:
committed by
Miek Gieben
parent
da230cd1fa
commit
f1b280de53
4
plugin/cache/item.go
vendored
4
plugin/cache/item.go
vendored
@@ -68,10 +68,6 @@ func (i *item) toMsg(m *dns.Msg) *dns.Msg {
|
||||
m1.Extra = make([]dns.RR, len(i.Extra))
|
||||
|
||||
ttl := uint32(i.ttl(time.Now()))
|
||||
if ttl < minTTL {
|
||||
ttl = minTTL
|
||||
}
|
||||
|
||||
for j, r := range i.Answer {
|
||||
m1.Answer[j] = dns.Copy(r)
|
||||
m1.Answer[j].Header().Ttl = ttl
|
||||
|
||||
Reference in New Issue
Block a user