Skip to main content

Module cache

Module cache 

Source
Expand description

Short-lived caches in front of a directory or an authorizer, to absorb bursts.

Cached wraps a provider and answers a repeated [Lookup] or authorization from memory for CacheOptions::ttl, or negative_ttl for an answer of “no such person” or “denied”. A credential is never cached: Cached does not implement Authenticator. An error is never cached either.

Needs the cache feature.

Structs§

CacheOptions
How long answers are kept, and how many.
Cached
A provider with its lookups and decisions kept for a short while.

Enums§

CacheSetting
A cache as configuration: true (the defaults), false (off), or CacheOptions.

Constants§

DEFAULT_MAX_ENTRIES
CacheOptions::max_entries by default.
DEFAULT_NEGATIVE_TTL
CacheOptions::negative_ttl by default: 1 s.
DEFAULT_TTL
CacheOptions::ttl by default: 5 s.

Traits§

CacheOptionsSetters
The typed setters of CacheOptions, for any builder that holds its settings.