Expand description
Content-Addressed Cache V2 — multi-tier eviction with admission control.
Provides a production-grade, purely in-memory cache keyed by 32-byte CIDs with:
- Hot tier: LRU eviction, short TTL, fastest access
- Warm tier: LFU eviction, longer TTL, larger capacity
- Bloom-filter admission gate: three FNV-1a hash functions prevent one-hit wonders
- Eviction log: bounded ring of the last 500 eviction events
- TTL sweep: single-pass expiry across both tiers
- Warm drain: simulate write-back of least-frequently-used 25% to slower storage
Structs§
- Cac2
Cache Config - Configuration knobs for
ContentAddressedCacheV2. - Cac2
Cache Stats - Snapshot of cache statistics.
- Cac2Cid
- 32-byte content identifier — a fixed-size, copy-friendly newtype.
- Cac2
Entry - Single entry stored in the hot or warm tier.
- Cac2
Eviction Record - A record of a single eviction event.
- Content
Addressed Cache V2 - Production-grade content-addressed cache with hot/warm tiering, Bloom-filter admission control, and rich eviction accounting.
Enums§
- Cac2
Eviction Reason - Why an entry was removed from the cache.
- Cac2
Tier - Cache tier designation.
Type Aliases§
- Cac2
Content Addressed Cache V2 - Alias for the main cache type.