Caching is a tradeoff between speed and consistency.
Layering model
- Output caching for read-heavy endpoints.
- Application cache for expensive domain computations.
- Distributed cache for shared state across nodes.
Always define cache invalidation rules before rollout.