aboutsummaryrefslogtreecommitdiff
path: root/plugin/cache/item.go (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-02-21incl addtl rrs when computing cache ttl (#1549)Gravatar Chris O'Haver 1-2/+6
2018-02-17Type.extra (#1538)Gravatar Miek Gieben 1-0/+5
* Revert "pkg/typify: empty messages are OtherError (#1531)" This reverts commit fc1d73ffa9ae193c4cfca4adc194ae43f9360dbb. * 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.
2018-01-17plugin/cache: Fix prefetching issues (#1363)Gravatar Tobias Schmidt 1-4/+4
* Improve plugin/cache metrics * Add coredns_cache_prefetch_total metric to track number of prefetches. * Remove unnecessary Cache.get() call which would incorrectly increment cache counters. * Initialize all counters and gauges at zero. * Allow prefetching of a single request per ttl The original implementation didn't allow prefetching queries which are only requested once during the duration of a TTL. The minimum amount of queries which had to be seen was therefore capped at 2. This change also implements a real prefetch test. The existing test was a noop and always passed regardless of any prefetch implementation. * Fix prefetching for items with a short TTL The default prefetch threshold (percentage) is 10% of the lifetime of a cache item. With the previous implementation, this disabled prefetching for all items with a TTL < 10s (the resulting percentage would be 0, at which point a cached item is already discarded). This change uses a time based threshold calculation and ensures that a prefetch is triggered at a TTL of 1 at the latest. * Fix wrong duration reporting of cached responses The logging and metrics plugins (among others) included the duration of a cache prefetch in the request latency of client request. This change fixes this wrong reporting and executes the prefetch request in a goroutine in the background.
2018-01-11Remove TTL ceiling at 5s in plugin/cache (#1380)Gravatar Tobias Schmidt 1-4/+0
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.
2017-09-14Remove the word middleware (#1067)Gravatar Miek Gieben 1-0/+116
* 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