djangors-cache 0.6.0

Cache backends and middleware for Djangors
Documentation

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 like get_or_set and JSON serialization/deserialization.
  • Implementations:
    • [InMemoryCache]: Fast in-memory backend using Moka cache.
    • [DatabaseCache]: SQL-database-backed cache using djangors_cache_entries table.
    • RedisCache: Distributed backend powered by Redis.
  • Tower Middleware: [CacheLayer] and [CacheService] intercept GET requests, serving and caching responses explicitly marked with the [CacheableResponse] extension.