DEV Community

Reese Cooper
Reese Cooper

Posted on

One small win from caching responses

Added a five-second cache to one expensive endpoint; median latency dropped by more than half. Not a deep insight: it was slow, we cached it, it got faster.

The interesting part was the failure mode. Stale data looked fine in tests and confused everyone in production once an hour. We now return the cache age in a header, which costs nothing and saved a lot of confused debugging.

Top comments (0)