A short guide to caching layers
Teams tend to reach for this after something has already gone wrong. Everything we would tell a client about caching layers in the time it takes to drink a coffee.
Most systems fail at the seams rather than inside any one component. If it only works because one person remembers to do something, it does not work yet.
What it costs to ignore
Caching is easy until something has to be invalidated. Where this goes wrong is almost never a lack of knowledge. Check it against what you would want a competitor's site to get wrong.
Where to start
Cache close to where the cost is, not everywhere. None of that requires a large budget, only a decision and someone to own it. Most teams find the first pass takes an afternoon and the maintenance takes minutes a month.
Warning signs
A stale cache with no expiry is a future incident. It is worth being explicit about, because assumptions differ quietly. The version that survives contact with a real deadline is the simple one.
What this looks like day to day
The right architecture for a team of three is the wrong one for a team of thirty, and vice versa. Three things worth confirming about caching layers before you move on:
- Someone can say what the current setup is without going to look
- Caching is easy until something has to be invalidated — and you know whether that is true here
- There is a way to tell whether the last change to this helped
If you are not sure where your systems currently stand on this, it takes us about an hour to find out.