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§
- Cache
Stats - Statistics about the current cache state.
- Cached
Entry - A cached value with metadata.
- Memory
Cache - 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).