cache-ro 0.2.0

A high-performance, thread-safe persistent cache with TTL support
Documentation

Persistent Cache for Rust

Crates.io Documentation License

A high-performance, thread-safe persistent cache with TTL support.

Features

  • 🚀 Thread-safe operations using DashMap
  • 💾 Optional persistent storage
  • ⏱ Time-to-live (TTL) support
  • 🔒 Key-level locking for safe concurrent access
  • 📦 Efficient binary serialization with bincode

Usage

Add to your Cargo.toml:

[dependencies]
cache-ro = "0.1"

Example

use cache_ro::{Cache, CacheConfig};
use std::time::Duration;

let cache = Cache::new(CacheConfig::default())?;
cache.set("my_key", "my_value".to_string(), Duration::from_secs(60))?;
let value: String = cache.get("my_key").unwrap();

Contributing

Contributions are welcome! Please open an issue or submit a PR for:

  • New features
  • Performance improvements
  • Bug fixes

License

Dual-licensed under MIT or Apache 2.0 at your option.