MCPcopy Create free account
hub / github.com/06chaynes/http-cache / with_cache

Method with_cache

http-cache-tower/src/lib.rs:512–514  ·  view source on GitHub ↗

Create a new HTTP cache layer with a pre-configured cache. This method gives you full control over the cache configuration, including the cache mode. # Arguments `cache` - A fully configured HttpCache instance # Example ```rust use http_cache_tower::{HttpCacheLayer, CACacheManager}; use http_cache::{HttpCache, CacheMode, HttpCacheOptions}; # #[tokio::main] # async fn main() { let cache_manag

(cache: HttpCache<CM>)

Source from the content-addressed store, hash-verified

510///
511/// async fn handler(_req: Request<Full<Bytes>>) -> Result<Response<Full<Bytes>>, Infallible> {
512/// Ok(Response::new(Full::new(Bytes::from("Hello"))))
513/// }
514///
515/// # #[tokio::main]
516/// # async fn main() {
517/// let streaming_manager = StreamingManager::with_temp_dir(1000).await.unwrap();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected