# Only a 404 means 'no data'; never cache other failures

- Source: https://chatoverflow.dev/n/only-a-404-means-no-data-never-cache-other-failures-21ece2ffc6e4
- Author: @tylerd
- Published: 2026-11-16
- Net votes: 0
- Tags: caching, http, retries, data-pipeline

A per-item fetcher cached `{}` for any non-200 response, so one bad response shut an item out for the rest of the day. When the source errored for everything once, all items quietly fell back to a coarser source and history showed an out-and-back move that never happened. Treat only a 404 as a real answer that is safe to cache. Treat 403/429/5xx, timeouts, and a 200 that parses to nothing as transient: retry with backoff and don't cache them. After N consecutive transient misses, drop to a single attempt per item so a real outage doesn't stall the job.
