Skip to main content

Module cache

Module cache 

Source
Expand description

Stale-while-revalidate cache for fetched provider data.

A JSON file on disk mirrored by an in-memory map. The TUI hydrates it once at startup and paints the last known data immediately, then repaints when the network answers — the cache exists to remove the blank screen you would otherwise stare at while the first fetch runs. Serving stale data is therefore the point, not a compromise.

Every failure mode here degrades to a miss or a no-op: a cache that can return an error is a cache that can break the app it was added to speed up.

Structs§

CacheEntry
A cached value plus when it was fetched.
CacheStore
JSON-file cache with atomic (temp + rename) writes and an in-memory mirror.

Enums§

CachePut
What a put did. Stale is the only outcome that means the caller is holding older data than the store — Disabled is not a refusal, it is a cache that simply isn’t storing anything, so a caller that repaints from what it just tried to write is still correct.