← Cache & Workers

Cache

cache-workers · workzone

The ephemeral acceleration layer for frequent reads: what to cache, what to key on, when contents go stale. The cache is a fast derivative that rebuilds if lost (Redis ⟂ Postgres hard boundary).

Cache policy

The only consumer today is search candidates from Query Engine (exact match on the query). We cache the expensive retrieval layer (cold start ~10 min), not the model's final answer — that answer is personalized and access-filtered, so it holds no shared value for a cache.

Cache

retrieval candidates — the shared, expensive layer

Don't cache

the final LLM answer — personalization · ACL

Key composition

The cache gate sits at the entrance to retrieval, before model and prompt selection — those don't affect the candidate set, so they aren't part of the key. The result is determined only by the query itself and the identity; stale candidates expire by TTL, no separate invalidation needed (cache gate in the RAG pipeline).

standalone query + identity
Query standalone query + identity
Key assembled from segments
hit ready candidates from redis-cache
miss expensive retrieval → write with TTL