Expand description
Cache module
Provides memory cache and Redis cache support.
§Features
- Memory cache: High-performance memory cache based on
moka, supportingTinyLFUeviction strategy - Redis cache: Supports distributed deployment (requires
cache-redisfeature)
§Examples
use crates_docs::cache::{Cache, CacheConfig, create_cache};
let config = CacheConfig::default();
let cache = create_cache(&config).expect("Failed to create cache");Modules§
- memory
- Memory cache implementation
Structs§
- Cache
Config - Cache configuration
Traits§
- Cache
- Cache trait
Functions§
- create_
cache - Create cache instance
- default_
crate_ docs_ ttl - Default crate document TTL (1 hour)
- default_
item_ docs_ ttl - Default item document TTL (30 minutes)
- default_
key_ prefix - Default key prefix
- default_
search_ results_ ttl - Default search result TTL (5 minutes)