feat(cache): use HTTP 404 for remote cache fetch misses - #772
Merged
Merged
Conversation
A fetch that matches neither key is now answered with HTTP 404, and the `not_found` kind is no longer part of the fetch response. The client returns `Fetched::NotFound` for a 404 and rejects a 200 response with `kind: "not_found"` as malformed. The test backend answers misses with a plain-text 404, as the public cache service does. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
wan9chi
force-pushed
the
remote-cache-fetch-404
branch
from
September 27, 2026 17:05
d03708b to
47880c1
Compare
fspy benchmarklinuxmacoswindows |
wan9chi
added this pull request to stack #773
September 27, 2026 17:16
`Client::fetch` now returns `Result<Option<Fetched>, Error>`, with `None` for a 404 response, instead of a `Fetched::NotFound` variant. `Fetched` now only describes the body of a 200 response, so it no longer needs a variant that no body decodes into. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The public cache service (#718) follows its RFC and answers a fetch that matches neither key with HTTP 404 and a plain-text body. It never sends
kind: "not_found". The client and the Node test backend still used a 200 response withkind: "not_found", so a miss meant different things depending on the server. This switches both to 404 and drops thenot_foundkind, giving the client and both servers one miss contract.Changes
vt_remote_cache:Client::fetchreturnsResult<Option<Fetched>, Error>, withNonefor a 404 response.Fetchedonly describes the body of a 200 response, so itsNotFoundvariant is removed. A 200 response withkind: "not_found"is now a malformed response. Every other non-200 status is still an error, and a 404 download still fails.packages/tools): a fetch miss gets a 404 with the bodyNot found, logged asPOST /fetch 404.vp runoutput is unchanged.