Expand description
Per-environment cache configuration loaded from the cache section of
config/<env>.yml.
CacheConfig selects the backend (memory, redis, or memcache) and
its endpoint, and CacheConfig::build turns that into a live
Arc<dyn CacheStore>. The Redis and Memcache backends are behind the
cache-redis / cache-memcache cargo features; selecting a backend whose
feature is not enabled yields a clear error.
Structs§
- Cache
Config - Cache settings, deserialized from the
cachesection ofconfig/<env>.yml. - Yaml
Config - File-based config deserialized from
config/<env>.yml. Only thecachesection is read; other sections (server, database, logger…) are ignored.
Enums§
- Cache
Backend - Which cache backend to use.
Functions§
- load
- Loads the current environment’s
CacheConfig, falling back to the default (in-memory) when the file is missing or has nocachesection.