Type.extra (#1538)

* Revert "pkg/typify: empty messages are OtherError (#1531)"

This reverts commit fc1d73ffa9.

* plugin/cache: add failsafeTTL

If we can not see what TTL we should put on a message to be cached, use
5 seconds as minimal TTL. We used to apply the maximum TTL to these
  messages.
This commit is contained in:
Miek Gieben 2018-02-17 19:45:52 +01:00 committed by GitHub
parent 9719a47c1b
commit 8cce06cba1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 37 deletions

View file

@ -171,7 +171,7 @@ func (w *ResponseWriter) set(m *dns.Msg, key int, mt response.Type, duration tim
case response.OtherError:
// don't cache these
default:
log.Printf("[WARNING] Caching called with unknown typification: %d", mt)
log.Printf("[WARNING] Caching called with unknown classification: %d", mt)
}
}
@ -186,8 +186,9 @@ func (w *ResponseWriter) Write(buf []byte) (int, error) {
}
const (
maxTTL = 1 * time.Hour
maxNTTL = 30 * time.Minute
maxTTL = 1 * time.Hour
maxNTTL = 30 * time.Minute
failSafeTTL = 5 * time.Second
defaultCap = 10000 // default capacity of the cache.