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§
- Cache
Entry - A cached value plus when it was fetched.
- Cache
Store - JSON-file cache with atomic (temp + rename) writes and an in-memory mirror.
Enums§
- Cache
Put - What a
putdid.Staleis the only outcome that means the caller is holding older data than the store —Disabledis 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.