{{ message }}
Repository navigation
fix(pages): answer middleware data misses with a 404 #3912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
james-elicx
wants to merge
4
commits into
main
Choose a base branch
from
fix/pages-data-miss-status
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9ccb51e
fix(pages): answer middleware data misses with a 404
james-elicx 46ed950
fix(pages): send data-miss 404s with the never-cache policy
james-elicx cc2e7e5
fix(pages): apply the data-miss cache policy after merging staged hea…
james-elicx b109a06
fix(pages): keep the data-miss cache policy through request-stage rec…
james-elicx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(pages): apply the data-miss cache policy after merging staged hea…
…ders
- Loading branch information
commit cc2e7e515a612940c57c3049d00457a5a34cff95
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
You can’t perform that action at this time.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This policy is still overwritten in the multi-stage Pages path. On an unmatched GET,
pages-request-stage-entry.tsmay dispatch the speculative 404 through the shared response stage; a middlewareCache-Controlvalue is captured insharedOuterPolicyHeaders, and after this return lines 672-674 callreconcileCdnResponseHeadersAfterOuterPolicy, whose lines 164-165 restore that value verbatim. Consequently middleware returningCache-Control: public, s-maxage=3600makes this data-miss 404 cacheable despite this reassertion. Apply the never-cache policy after that reconciliation (or prevent reconciliation for this synthetic response), and cover the request-stage caller rather than onlyrunPagesRequestdirectly.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in b109a06: the pipeline result for this synthetic 404 now carries
finalCachePolicy: true, andpages-request-stage-entry.tsskipsreconcileCdnResponseHeadersAfterOuterPolicyfor it. Added a request-stage test inpages-request-worker-stage.test.ts(middlewareCache-Control: public, s-maxage=3600, a shared speculative 404 dispatch) that fails on the previous head.