Learning Roadmap
- Install —
pip install pico-caching (Getting Started). - First hit —
@cacheable on an expensive lookup; verify with a call counter that the second call is free. - Tune TTL — per-method
ttl_seconds vs caching.default_ttl_seconds. - Custom keys —
key=lambda user_id: f"user:{user_id}" when reprs are noisy. - Your backend — implement
CacheBackend as a @component (Redis, memcached); it replaces the built-in automatically (Architecture). - Invalidate — inject the backend;
delete/clear until @cache_evict exists.