Crate salvo_cache

source ·
Expand description

Cache middleware for Salvo.

Cache middleware for Salvo designed to intercept responses and cache them. This middleware will cache the response’s StatusCode, Headers and Body.

You can define your custom CacheIssuer to determine which responses should be cached, or you can use the default RequestIssuer.

The default cache store is MemoryStore, which is a wrapper of moka. You can define your own cache store by implementing CacheStore.

Example: cache-simple

Re-exports

Modules

Structs

  • A constructed via salvo_cache::Cache::builder().
  • Cached entry which will be stored in the cache store.
  • Skipper for Method. You can use it to skip some methods.
  • Identify user by Request Uri.

Enums

  • CachedBody is used to save response body to CachedStore.

Traits