Home

Caches are great but they are not for fast

Last updated 27 November 2026

http://latencytipoftheday.blogspot.com/2014/06/latencytipoftheday-most-page-loads.html https://brooker.co.za/blog/2021/04/19/latency.html

These blogs both talk about how tail latency (99th percentile) can impact a surprising number of users. latencytipoftheday speaks about page loads which typically have tens to hundreds of api calls. At ~69 calls per page load, roughly 50% of page loads hit that 99th percentile.

Brooker has an important idea - that where possible, do things in parallel. If the tail blocks loading the whole resource, 50% of your page loads are now slow as hell. So try to separate stuff. But that’s not what this is about.

However this got me thinking about caches. A cache hit-rate of >95% is considered pretty good. I’d be happy with that. However, the above shows that it’s not good enough. I don’t think it’s feasible to get a cache up to 99.99+% hit rate (if you did, are you sure your persistent storage needs to exist..? A bit facetious but it’s worth thinking about why caching is so easy for you). So, what’s clear here is that you cannot rely on your cache for speed.

Caches are typically faster because they run closer to the user, on hardware that’s faster (RAM vs SSD vs network call). As a result of this, we can often think that a cache’s job is to improve speed but in reality it should be used to protect slow hardware. If a DB is struggling due to concurrent connections we put a cache in front of it so that repeated queries do not cause duplicate connections. Not because it’s ‘faster’ to read out of the cache.

Part of the reason we think caches make our system fast is because often used in response to a slowness symptom. What is the problem with too many concurrent db connections? They contend for locks and they become slow. So the signal we’re responding to is slowness. So we put in a cache and things become fast. Ergo caches are fast? No, it’s fast because the cache has protected vulnerable hardware.