We Built a Cache That Made the System Slower
A team added a Redis caching layer to speed up a slow API endpoint. Response times got worse. The cache was working perfectly — it was caching the wrong thing.
- Key API endpoint serving the product's main dashboard was slow under load
- Customer complaints escalating — largest enterprise account threatened to churn
- Team spent 3 weeks building a caching layer that made the problem worse
The largest enterprise customer was in renewal negotiations. Dashboard load time was their top complaint. Three weeks of engineering effort made the problem worse instead of better. The pressure to show progress was creating more regressions than improvements.
The Scenario
You're a senior engineer at a SaaS company. The dashboard API endpoint takes 4 seconds under load. The product team is escalating. Your tech lead proposes adding a Redis caching layer to cache the database query results. It'll take about a week to implement. What's your response?
No hints. Just judgment.
Caching the full API response eliminates all backend work and delivers fast responses. But dashboard data has freshness expectations — enterprise customers expect near-real-time metrics. Any TTL that meaningfully reduces backend load also introduces staleness that customers notice. You're trading latency for correctness, and for dashboards used for operational decisions, that's a trade most customers won't accept.
- Profile before you optimize — assumptions about bottlenecks are usually wrong
- Caching the wrong layer adds complexity without improving performance
- Database engines are better at aggregation than application code — push computation down when possible
- The standard fix isn't always the right fix — match the solution to the measured problem
- A day of profiling is cheaper than a week of building the wrong cache
- Dashboard response time reduced from 4 seconds to 500ms — an 87% improvement
- No caching infrastructure required — eliminated ongoing operational cost
- Enterprise account retention risk resolved
- Profiling-first approach adopted as team standard for performance work