Cache
Keeping a recent answer close at hand so the system doesn't pay again, in time or money, to work it out.
Updated October 2026 · with examples from our own builds
What does cache mean in practice?
A cache stores the result of an expensive step, such as a database aggregation, a rendered page or a paid API call, and serves the stored copy until it expires or is cleared. Done well, screens get faster and bills get smaller.
It only helps when the same question is asked again. If the question changes slightly every time, every lookup misses and you pay full price while believing you're saving. And a cache that isn't cleared when data changes shows people stale information.
You don't need to design caches yourself, but two questions are worth asking about any expensive feature: what is cached, and what clears it?
Cache at a glance
- Saves
- Response time and paid calls
- Fails silently when
- The cache key changes on every request
- Ask
- What clears it when the data changes?
Where has cache come up in our builds?
Google Directions routes were cached in Redis with coordinates rounded to about 1.1 metres, so a moving vehicle missed the cache every time and live tracking billed a call every ten seconds per open map. The fix stopped movement itself from requesting routes; business quotes now price on real road distance with a route cache that does get reused.
Unread counts moved to a Redis counter per user and room, seeded once from MongoDB and cleared when the room is read, replacing an aggregation per participant on every message. Cached rooms and totals are deleted on every send and read, and if Redis fails the code falls back to the aggregation.
Common questions about cache
Why is my app showing out-of-date information?
Often a cache that isn't cleared when the underlying data changes. Each cached item needs a rule for when it is removed, such as on every write that affects it, which is how Trainr keeps chat previews current.
Can a healthy cache still leave a large API bill?
Yes. Pakka's route cache was working and every miss was legitimate, because the cache key changed with every driver movement. The saving came from fetching less often, not from caching more.
Related terms
Sources
Planning a product and not sure where cache fits? Ask us, or browse all 116 terms in the glossary.