Skip to main content

Module cache

Module cache 

Source
Expand description

The on-disk catalog cache.

A cache younger than TTL_SECS is served without touching the network. An older one triggers a refresh, and a failed refresh falls back to the stale copy - the caller tells staleness from crate::model::Catalog::age_secs. Only a cache miss with no reachable network is an error.

Constants§

TTL_SECS
How long a cached catalog stays fresh.

Functions§

load
Returns the catalog, from cache where it is fresh and from the network otherwise.
read
Reads the cache file. An unreadable or unparseable file is a miss, not an error.
write
Writes the catalog as a normalised JSON document.