From 86930ed414f9243ca75679b924bf26f5940eb8c9 Mon Sep 17 00:00:00 2001 From: AmineChikhaoui Date: Mon, 2 Apr 2018 17:41:49 +0100 Subject: add documentation for the local disk cache TTL config --- doc/manual/command-ref/conf-file.xml | 24 ++++++++++++++++++++++++ src/libstore/globals.hh | 14 ++++++++------ 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/doc/manual/command-ref/conf-file.xml b/doc/manual/command-ref/conf-file.xml index 6638bf61e454..1033d385e79d 100644 --- a/doc/manual/command-ref/conf-file.xml +++ b/doc/manual/command-ref/conf-file.xml @@ -788,6 +788,30 @@ password my-password + negative-disk-cache-ttl + + + + The TTL in seconds for negative lookups. If a store path is queried from a substituer but + was not found, there will be a negative lookup cached in the local disk cache database for the specified + duration. + + + + + + positive-disk-cache-ttl + + + + The TTL in seconds for positive lookups. If a store path is queried from a substituer, the result of + the query will be cached in the local disk cache database including some of the NAR metadata. Setting a TTL + for positive lookups can be useful in case of builds that aren't reproducible, in which case having a more + frequent cache invalidation would prevent hash mismatch issues. + + + + diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh index 36c8b7357904..00147f615f49 100644 --- a/src/libstore/globals.hh +++ b/src/libstore/globals.hh @@ -310,15 +310,17 @@ public: "Disabled substituters that may be enabled via the substituters option by untrusted users.", {"trusted-binary-caches"}}; - Setting ttlNegativeDiskCache{this, 3600, "negative-disk-cache-ttl", - "The TTL in seconds for negative lookups in the disk cache."}; - - Setting ttlPositiveDiskCache{this, 30 * 24 * 3600, "positive-disk-cache-ttl", - "The TTL in seconds for positive lookups in the disk cache."}; - Setting trustedUsers{this, {"root"}, "trusted-users", "Which users or groups are trusted to ask the daemon to do unsafe things."}; + Setting ttlNegativeDiskCache{this, 3600, "negative-disk-cache-ttl", + "The TTL in seconds for negative lookups in the disk cache i.e binary cache lookups that " + "return an invalid path result"}; + + Setting ttlPositiveDiskCache{this, 30 * 24 * 3600, "positive-disk-cache-ttl", + "The TTL in seconds for positive lookups in the disk cache i.e binary cache lookups that " + "return a valid path result."}; + /* ?Who we trust to use the daemon in safe ways */ Setting allowedUsers{this, {"*"}, "allowed-users", "Which users or groups are allowed to connect to the daemon."}; -- cgit 1.4.1