From: Peter van Dijk Date: Wed, 2 Aug 2017 08:31:15 +0000 (+0200) Subject: add dontAge to packetcache guide X-Git-Tag: dnsdist-1.2.0~40^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0873499b166e9a128bc9d7586af03d96f135cd43;p=pdns add dontAge to packetcache guide --- diff --git a/pdns/dnsdistdist/docs/guides/cache.rst b/pdns/dnsdistdist/docs/guides/cache.rst index e71fd6308..da913a186 100644 --- a/pdns/dnsdistdist/docs/guides/cache.rst +++ b/pdns/dnsdistdist/docs/guides/cache.rst @@ -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.