litestar-caching
Installation
SKILL.md
Caching
Execution Workflow
- Identify handlers whose responses are deterministic, expensive, and safe to replay.
- Choose the route-level cache mode:
cache=True, an explicit TTL in seconds, orCACHE_FOREVER. - Set app-level
ResponseCacheConfigfordefault_expiration, store selection, and global key/filter behavior. - Design cache keys around every dimension that changes the payload: path, query params, method, tenant, locale, auth scope, feature flags, or headers.
- Decide how stale data is controlled for mutable resources: short TTL, explicit delete, or versioned keys.
- Verify hits, misses, and stale-data behavior with tests before treating the cache as production-safe.