Expand description
Redis-backed exact-match response cache.
The cache key is a SHA-256 hash of the canonical JSON serialization of the
ChatRequest. Because the request struct derives [Serialize], the
hash is deterministic for identical requests regardless of field insertion
order (serde always serialises struct fields in declaration order).
Cache entries expire after DEFAULT_TTL_SECS seconds; callers can
override this via ExactMatchCache::with_ttl.
The cache gracefully degrades: if Redis is unavailable all get/set
calls return None/Ok(()) without surfacing errors to the caller.
Structs§
- Exact
Match Cache - Exact-match Redis cache for
ChatResponsevalues.
Constants§
- DEFAULT_
TTL_ SECS - Default TTL for cached responses (5 minutes).