Raw-byte caches, common backends, and explicitly opted-in response caching.
This crate provides a unified interface for key-value caching:
- [
Cache]: The core trait defining raw-byte get, set, and delete operations. - [
CacheExt]: Extension trait providing higher-level helpers likeget_or_setand JSON serialization/deserialization. - Implementations:
- [
InMemoryCache]: Fast in-memory backend using Moka cache. - [
DatabaseCache]: SQL-database-backed cache usingdjangors_cache_entriestable. RedisCache: Distributed backend powered by Redis.
- [
- Tower Middleware: [
CacheLayer] and [CacheService] intercept GET requests, serving and caching responses explicitly marked with the [CacheableResponse] extension.