Add MINTTL parameter to cache configuration. (#2055)

* Add success min TTL parameter to cache.

* Add MINTTL to README.

* Update README.

* Add MINTTL to negative cache.

* Remove unnecessary variable name.

* Address review comments.

* Configure cache in TestCacheZeroTTL to have 0 min ttl.
This commit is contained in:
Aaron Riekenberg
2018-09-03 14:26:02 -05:00
committed by Tobias Schmidt
parent 4c6c9d4b27
commit b42eae7a04
5 changed files with 111 additions and 31 deletions

View File

@@ -32,8 +32,8 @@ If you want more control:
~~~ txt
cache [TTL] [ZONES...] {
success CAPACITY [TTL]
denial CAPACITY [TTL]
success CAPACITY [TTL] [MINTTL]
denial CAPACITY [TTL] [MINTTL]
prefetch AMOUNT [[DURATION] [PERCENTAGE%]]
}
~~~
@@ -41,8 +41,10 @@ cache [TTL] [ZONES...] {
* **TTL** and **ZONES** as above.
* `success`, override the settings for caching successful responses. **CAPACITY** indicates the maximum
number of packets we cache before we start evicting (*randomly*). **TTL** overrides the cache maximum TTL.
**MINTTL** overrides the cache minimum TTL, which can be useful to limit queries to the backend.
* `denial`, override the settings for caching denial of existence responses. **CAPACITY** indicates the maximum
number of packets we cache before we start evicting (LRU). **TTL** overrides the cache maximum TTL.
**MINTTL** overrides the cache minimum TTL, which can be useful to limit queries to the backend.
There is a third category (`error`) but those responses are never cached.
* `prefetch` will prefetch popular items when they are about to be expunged from the cache.
Popular means **AMOUNT** queries have been seen with no gaps of **DURATION** or more between them.