60 Percent of My API Calls Were Cached. I Turned It Off.
It is Tuesday afternoon. I am looking at my Grafana dashboard. The cache hit rate says 60 percent. Six out of ten API requests are being served from Redis, not the database.
By every metric I learned, this should be a win. Cache hits are fast. Database queries are slow. The math is simple.
But my p95 latency went up 40 milliseconds after I added caching.
Not down. Up.
I spent three days chasing this. I added more cache. I tuned TTLs. I pre-warmed the cache with likely queries. Nothing helped. The more I cached, the slower things got.
Then I found the bug. It wasn’t in the cache layer. It wasn’t in the database. It was in my assumptions about what caching actually does.