Intuition
A cache keeps likely-needed information close by to avoid repeating expensive work.
Technical definition
Caching is a storage strategy that trades memory and invalidation complexity for lower access latency or reduced recomputation.
Example
A web app may cache API responses to avoid repeated database queries.
Common misunderstandings
- Caches create consistency and invalidation problems.
- A stale cache can be worse than no cache for some data.