A 404 under /assets is not kept for a year - #623
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
WaylandYang
deleted the
fix/a-404-under-assets-is-not-kept-for-a-year
branch
September 12, 2026 10:57
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.
Found while running the end-to-end pass over #615's own contract, on a deployment built from it.
The header went on with
SetResponseHeaderLayer::overriding, which does not look at the response, so the 404 for a missing asset was labelled cacheable for a year. It is the same failure chain #616 described, entering from the other end: asset names carry a content hash, so the request right after a deploy asks for the new name — and a browser that asked for it a moment too early has now been told, for a year, that it does not exist.The header is now chosen from the status:
immutableon success,no-cacheotherwise.A test, because this is the second time
The static-file mounting is now its own stateless
with_static_files(app, web_dist), so it can be exercised without a database. Three tests pin status, content type and cache directive together for a served asset, a missing asset, and a page route — each of the two regressions so far would have been caught by exactly one of those three assertions, and by only one, which is why all three are asserted every time.tower(foroneshot) andtempfilejoin the server's dev-dependencies;tempfilewas already pinned in the workspace and unused.🤖 Generated with Claude Code