jedarlington
Blog

FuelFinder, six weeks on: fixing the caching problem I shipped with

July 21, 2026

When I first wrote up FuelFinder I flagged the obvious gap: no caching, so every visitor hammers the open data feed directly. Six weeks and a small but real bump in traffic later, it was time to actually deal with it instead of just admitting it in a blog post.

The fix wasn’t clever — a short-lived cache keyed by rounded lat/lng plus fuel type, so nearby requests within the same few minutes share a result instead of each triggering a fresh fetch. No Redis, no infrastructure, just an in-memory layer with a sensible TTL that matches how often the feed itself actually updates. Refreshing every 30 minutes and re-fetching on every page load was always wasted work.

The interesting bit was getting the cache key right. Round the coordinates too coarsely and someone on one side of town gets prices from a station miles away; too precise and the cache barely helps anyone. I settled on a grid roughly the size of a small town centre, which cut outbound requests by more than half without anyone noticing a difference in what they saw on the map.

Still no framework, still no real backend — just a slightly less naive version of the same weekend project. Updated code is on GitHub.