Overview
CacheForge is an in-memory caching library for Rust applications. It features TTL-based expiration, LRU eviction policies, and an async-first API built on Tokio.
Design Goals
- Zero-copy reads where possible
- Lock-free concurrent access using DashMap
- Configurable eviction policies (LRU, LFU, TTL)
- Async-native API for Tokio-based applications
- Metrics and introspection for debugging
let cache = CacheForge::builder()
.max_capacity(10_000)
.ttl(Duration::from_secs(300))
.eviction(EvictionPolicy::Lru)
.build();
cache.insert("key", value).await;
let result = cache.get("key").await;