16 releases (5 breaking)
new 0.42.0 | May 29, 2023 |
---|---|
0.41.1 | May 12, 2023 |
0.40.0 | Apr 30, 2023 |
0.39.1 | Apr 28, 2023 |
0.0.1 | Oct 3, 2022 |
#10 in #salvo
949 downloads per month
Used in salvo
520KB
12K
SLoC
salvo-cache
Cache middleware for Savlo.
This is offical crate, so you can enable it in Cargo.toml
like this:
salvo = { version = "*", features=["cache"] }
lib.rs
:
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
Dependencies
~15–24MB
~510K SLoC