Skip to main content

Module cache

Module cache 

Source
Expand description

Pluggable caching for fetched provider results.

CacheBackend is the trait host apps implement to plug in tier-1 storage (default MemoryBackend is in-process), tier-2 storage (IndexedDbBackend lands in phase 3b), or anything else they like (Redis, file-system, etc.).

CachedEntry carries the DataTable, the wall-clock time it was fetched, the TTL, free-form bulk-invalidation tags, and provider metadata so cache-hits return identical metadata to the original fetch.

Structs§

CachedEntry
One cached source entry. Cloning is cheap because DataTable is Arc-backed; metadata + tag clones are a small HashMap/Vec.
MemoryBackend
Default in-process tier-1 cache. Arc<Mutex<HashMap<u64, CachedEntry>>> — no async I/O, no external dependencies, identical behavior on native and WASM.

Enums§

CacheError
Cache backend errors. Backed by thiserror so backends can wrap their native error type (Mutex poisoning, IndexedDB errors, IO errors, etc.).

Traits§

CacheBackend
Pluggable cache backend trait. ?Send on WASM mirrors the DataSourceProvider / TransformMiddleware story so single-threaded browser environments don’t need Send bounds.