Skip to main content

Module cache

Module cache 

Source
Expand description

Cache system — Memory LRU (moka) + SQLite disk (PRD §28).

Phase 1: In-memory LRU cache using the moka crate. Phase 2+: Disk-backed SQLite cache for cross-session persistence.

Cache key convention:

  • Fetch: “fetch:{url}”
  • Search: “search:{query}:{backend}:{max_results}”
  • QATBE: “qatbe:{url}:{query}:{budget}”

Structs§

CacheStats
Statistics about the current cache state.
CachedEntry
A cached value with metadata.
MemoryCache
In-memory LRU cache for fetch and search results.

Functions§

fetch_key
Build a cache key for a fetch operation (collision-resistant).
qatbe_key
Build a cache key for a QATBE operation (collision-resistant).
search_key
Build a cache key for a search operation (collision-resistant).