Serve a cached variant while its source URL is in the negative cache (closes #245) #268

Open
clawbot wants to merge 4 commits from issue-245-serve-cached-before-negative-cache into next
4 Commits
Author SHA1 Message Date
sneak 3321627eb6 Check the negative cache only before a fetch from the upstream (closes #245)
check / check (push) Waiting to run
The check moves from Get to the start of fetchAndProcess, so a variant
not in the cache is still made from a cached source while the URL is in
the negative cache. A refusal now counts as a miss.

Model: opus-5-5
2026-10-15 08:10:45 +00:00
sneak 6db0d632e3 Test that a variant is made from a cached source of a negative-cached URL
The negative cache refuses only a fetch from the upstream: a variant not
in the cache is made from the cached source, and refused once that
source is evicted.

Model: opus-5-5
2026-10-15 08:10:25 +00:00
sneak ef32da807e Serve a cached variant while its source URL is negative-cached (closes #245)
Get checked the negative cache before it looked for the variant on
disk, so after one failed fetch of a source every cached variant of it
answered 502 for 5 minutes. Get now serves a cached variant first and
checks the negative cache only on a miss, before processing. The 502
line under /v1/image/ in README.md and TODO.md say so.

Model: opus-5-5
2026-10-15 08:10:25 +00:00
sneak 31f2b6ea55 Test that a cached variant is served while its URL is negative-cached
Get refuses a cached variant with the negative-cache error while its
source URL has a negative-cache row. The new test caches a variant,
stores a row for its URL, and expects the variant to be served from the
cache, and a variant not in the cache to be refused as before. It fails
until Get checks the negative cache only on a miss
(#245).

Model: opus-5-5
2026-10-15 08:10:25 +00:00