hitbox
Hitbox is an asynchronous caching framework supporting multiple backends and suitable for distributed and for single-machine applications.
Framework integrations
- Actix
- Actix-Web
Features
- Automatic cache key generation.
- Multiple cache backend implementations:
- Stale cache mechanics.
- Cache locks for dogpile effect preventions.
- Distributed cache locks.
- Detailed metrics out of the box.
Backend implementations
- Redis
- In-memory backend
Feature flags
- derive - Support for Cacheable trait derive macros.
- metrics - Support for metrics.
Restrictions
Default cache key implementation based on serde_qs crate and have some restrictions.
Documentation
Example
Dependencies:
[]
= "0.1"
Code:
NOTE: Default cache key implementation based on serde_qs crate and have some restrictions.
First, you should derive Cacheable trait for your struct or enum:
use *;
use ;
// With features=["derive"]
Or implement that trait manually:
use ;