Commit graph

3 commits

Author SHA1 Message Date
Miek Gieben
1e71d0e2c1 plugin/cache: don't cache msg with TTL=0 in them ()
Don't cache these - may be lead to weird side effects.

Fixes 
2017-09-28 14:22:23 +01:00
Miek Gieben
cd5879f866 plugin/cache: cap TTL on first answer ()
Cache would let the first response through and would then cap subsequent
ones to whatever the cache duration was. This would lead to huge drops
in TTL values: 3600 -> 20 for instance, which is not only bad, but can
mess up your careful TTL planning business.

This PR fixes that and applies the cache duration to all replies. As a
bonus I could remove a time.Sleep() from the cache test and just check
for the cache duration as the TTL on the reply.

Fixes 
2017-09-20 11:36:41 +01:00
Miek Gieben
d8714e64e4 Remove the word middleware ()
* Rename middleware to plugin

first pass; mostly used 'sed', few spots where I manually changed
text.

This still builds a coredns binary.

* fmt error

* Rename AddMiddleware to AddPlugin

* Readd AddMiddleware to remain backwards compat
2017-09-14 09:36:06 +01:00
Renamed from middleware/cache/cache.go (Browse further)