Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::NarInfoDiskCacheSettings Struct Reference
Inheritance diagram for nix::NarInfoDiskCacheSettings:
nix::Config nix::AbstractConfig nix::Settings

Public Attributes

Setting< unsigned int > ttlNegative
Setting< unsigned int > ttlPositive
Setting< unsigned int > ttlMeta

Additional Inherited Members

Public Types inherited from nix::Config
using Settings = std::map<std::string, SettingData>
Public Member Functions inherited from nix::Config
 Config (StringMap initials={})
bool set (const std::string &name, const std::string &value) override
void addSetting (AbstractSetting *setting)
void getSettings (std::map< std::string, SettingInfo > &res, bool overriddenOnly=false) const override
void resetOverridden () override
nlohmann::json toJSON () override
std::string toKeyValue (bool overriddenOnly=false) override
void convertToArgs (Args &args, const std::string &category) override
Public Member Functions inherited from nix::AbstractConfig
void applyConfig (const std::string &contents, const std::string &path="<unknown>")
void warnUnknownSettings ()
void reapplyUnknownSettings ()
Protected Member Functions inherited from nix::AbstractConfig
 AbstractConfig (StringMap initials={})
Protected Attributes inherited from nix::AbstractConfig
StringMap unknownSettings

Member Data Documentation

◆ ttlMeta

Setting<unsigned int> nix::NarInfoDiskCacheSettings::ttlMeta
Initial value:
{
this,
7 * 24 * 3600,
"narinfo-cache-meta-ttl",
R"(
The TTL in seconds for caching binary cache metadata (i.e.
`/nix-cache-info`). This determines how long information about a
binary cache (such as its store directory, priority, and whether it
wants mass queries) is considered valid before being refreshed.
)"}

◆ ttlNegative

Setting<unsigned int> nix::NarInfoDiskCacheSettings::ttlNegative
Initial value:
{
this,
3600,
"narinfo-cache-negative-ttl",
R"(
The TTL in seconds for negative lookups.
If a store path is queried from a [substituter](#conf-substituters) but was not found, a negative lookup is cached in the local disk cache database for the specified duration.
Set to `0` to force updating the lookup cache.
To wipe the lookup cache completely:
```shell-session
$ rm $HOME/.cache/nix/binary-cache-v*.sqlite*
# rm /root/.cache/nix/binary-cache-v*.sqlite*
```
)"}

◆ ttlPositive

Setting<unsigned int> nix::NarInfoDiskCacheSettings::ttlPositive
Initial value:
{
this,
30 * 24 * 3600,
"narinfo-cache-positive-ttl",
R"(
The TTL in seconds for positive lookups. If a store path is queried
from a substituter, the result of the query is cached in the
local disk cache database including some of the NAR metadata. The
default TTL is a month, setting a shorter TTL for positive lookups
can be useful for binary caches that have frequent garbage
collection, in which case having a more frequent cache invalidation
would prevent trying to pull the path again and failing with a hash
mismatch if the build isn't reproducible.
)"}

The documentation for this struct was generated from the following files:
  • libstore/include/nix/store/globals.hh
  • libstore/globals.cc