Repository navigation
fix(frontend): 404 no-store for missing static assets - #72
Merged
Merged
Conversation
…of index.html The SPA fallback served index.html for missing /assets/* files while the path-based header policy gave the response a long public cache lifetime. During rolling deploys a pod asked for another release's hashed bundle returned HTML, Cloudflare cached it under the bundle URL, and the site broke for everyone until the entry expired.
There was a problem hiding this comment.
Adds a 404/no-store path for missing static assets so SPA fallback can't be cached under hashed asset URLs. Verified the handler's no-store correctly overrides the earlier middleware-set long-cache header, that the extension list plus the assets/ prefix covers the production policy's extension set, and that the new test compiles against real signatures (PrewarmRoutes takes any, LoadHeadData tolerates missing head.json) with all eight table cases consistent with the code. Clean.
Reviewed 2 changed file(s) @ 11f7c9ca — no blocking issues found.
"Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law." — Douglas Hofstadter
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.
Missing static assets (anything under
assets/or with a static file extension) now return 404 withCache-Control: no-storeinstead of falling back toindex.html. The fallback response was picking up the path-based long-cache header, so during rolling deploys Cloudflare cached HTML under hashed bundle URLs and lab.ethpandaops.io served "text/html" for its main script until the entry expired. Extensionless SPA routes still getindex.html.