]> granicus.if.org Git - pdns/commitdiff
add dontAge to packetcache guide
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Wed, 2 Aug 2017 08:31:15 +0000 (10:31 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Wed, 2 Aug 2017 08:31:15 +0000 (10:31 +0200)
pdns/dnsdistdist/docs/guides/cache.rst

index e71fd6308f3fc779883497165852f7ccc2ee8471..da913a186c753c0176e918900d6b4311f830b220 100644 (file)
@@ -3,15 +3,15 @@ Caching Responses
 
 :program:`dnsdist` implements a simple but effective packet cache, not enabled by default.
 It is enabled per-pool, but the same cache can be shared between several pools.
-The first step is to define a cache, then to assign that cache to the chosen pool, the default one being represented by the empty string::
+The first step is to define a cache with :func:`newPacketCache`, then to assign that cache to the chosen pool, the default one being represented by the empty string::
 
-  pc = newPacketCache(10000, 86400, 0, 60, 60)
+  pc = newPacketCache(10000, 86400, 0, 60, 60, false)
   getPool(""):setCache(pc)
 
 The first parameter (10000) is the maximum number of entries stored in the cache, and is the only one required.
-All the other parameters are optional and in seconds.
+All the other parameters are optional and in seconds, except the last one which is a boolean.
 The second one (86400) is the maximum lifetime of an entry in the cache, the third one (0) is the minimum TTL an entry should have to be considered for insertion in the cache, the fourth one (60) is the TTL used for a Server Failure or a Refused response.
-The last one (60) is the TTL that will be used when a stale cache entry is returned.
+The fifth one (60) is the TTL that will be used when a stale cache entry is returned. The sixth one is a boolean that when set to true, avoids reducing the TTL of cached entries.
 
 For performance reasons the cache will pre-allocate buckets based on the maximum number of entries, so be careful to set the first parameter to a reasonable value.
 Something along the lines of a dozen bytes per pre-allocated entry can be expected on 64-bit.