Skip to main content

Module cache

Module cache 

Source
Expand description

Document cache module

Provides document-specific cache service with support for independent TTL configuration for crate docs, search results, and item docs.

§Cache key format

  • Crate documentation: crate:{name} or crate:{name}:{version}
  • Search results: search:{query}:{limit}
  • Item documentation: item:{crate}:{path} or item:{crate}:{version}:{path}

§Examples

use std::sync::Arc;
use crates_docs::tools::docs::cache::{DocCache, DocCacheTtl};
use crates_docs::cache::memory::MemoryCache;

let cache = Arc::new(MemoryCache::new(1000));
let doc_cache = DocCache::new(cache);

Structs§

CacheKeyGenerator
Cache key generator for document cache
CacheStats
Cache statistics tracker
DocCache
Document cache service
DocCacheTtl
Document cache TTL configuration