Expand description
Example: Cache management.
use oximedia_proxy::{CacheManager, CacheStrategy};
let cache_dir = std::path::PathBuf::from("/var/cache/proxies");
let max_size = 10 * 1024 * 1024 * 1024; // 10 GB
let mut cache = CacheManager::new(cache_dir, max_size);
cache.set_strategy(CacheStrategy::Lru);
// Add proxies to cache
cache.add(std::path::PathBuf::from("proxy1.mp4"), 100_000_000);
cache.add(std::path::PathBuf::from("proxy2.mp4"), 150_000_000);
println!("Cache utilization: {:.1}%", cache.utilization());Functionsยง
- cleanup_
cache - Clean up cache based on policy.
- setup_
cache - Set up and manage proxy cache.