Expand description
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:
CacheLayerandCacheServiceintercept GET requests, serving and caching responses explicitly marked with theCacheableResponseextension.
Structs§
- Cache
Layer - Tower middleware layer for caching responses marked with
CacheableResponse. - Cache
Service - Tower service middleware that intercepts GET requests and serves/caches responses.
- Cacheable
Response - Request/response extension marker indicating that a response is cacheable by
CacheLayer. - Database
Cache - A database-backed cache backend storing entries in
djangors_cache_entries. - InMemory
Cache - An in-memory cache backend powered by Moka.
Enums§
- Cache
Error - Errors encountered during cache access or value serialization.
Traits§
- Cache
- An object-safe cache of raw byte values.
- Cache
Ext - Extension trait providing convenient
get_or_sethelpers on anyCache.
Functions§
- get_
or_ set_ fragment - Helper function to retrieve or compute a template fragment or raw byte cache entry.