ISSUE DESCRIPTION Pages Router: gssp/getStaticProps responses missing default and…
- User
ISSUE DESCRIPTION
Pages Router: gssp/getStaticProps responses missing default and user-set
Cache-ControlheaderThis issue was created by an agent analysing CI failures from the Next.js Deploy Suite (vinext
mainvs Next.jsv16.2.6, 2026-05-22).Problem
Pages Router gssp responses lack
Cache-Controlheaders. Tests expect the defaultprivate, no-cache, no-store, max-age=0, must-revalidatefor gssp pages and custom values set viares.setHeader('Cache-Control', ...), but vinext returnsnull. The default header is not applied and usersetHeadercalls are dropped.Expected: "private, no-cache, no-store, max-age=0, must-revalidate" Received: nullEstimated Impact
~2 test failures across the deploy suite.
Affected Test Suites
test/e2e/getserversideprops/test/index.test.ts(2 failures)
Recommendation
-
Reproduce first in vinext's own test suite. Add a Pages Router gssp page and assert the response carries the default
Cache-Controlheader; add a second page that overrides it viares.setHeaderand assert the override sticks. -
Emit the default gssp Cache-Control. When serving a gssp response in deploy mode, set
Cache-Control: private, no-cache, no-store, max-age=0, must-revalidateunless the user set it explicitly. -
Preserve
res.setHeaderoverrides. Make sure headers set during gssp dispatch are forwarded to the final HTTP response.
Interface
No new interfaces are introduced.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusor commands. However you don't need to use or before submitting your changes. In fact, only submits currently unstaged changes because it uses to get the changes that need to be submitted. Assistant
I'll start by exploring the repository structure.
Assistant
Now let me write a temporary reproduction test.
Assistant
Now implement the fix in
pages-page-response.ts.Assistant
Now update the tail of that function and add the internal HTML wrapper.
Assistant
Now update the import of
NEVER_CACHE_CONTROLand check the ISR/nonce override ordering.Assistant
Now add the import of the helper in the generated entry and update
buildNextDataJsonResponseto merge Headers properly.Assistant
Now update
buildNextDataJsonResponseto mergeHeadersInitproperly.Assistant
Now edit dev-server: track gssp usage and add default cache-control.
Assistant
Now add the helper function and use it in both dev paths.
Assistant
Now update the dev data-request branch and the HTML extraHeaders block.
Assistant
Safe. Let me add the fixture page.
Assistant
Now let me write a temp dev + prod integration check.
Assistant
Now update the gssp block to compute
gsspSetCacheControl.Assistant
Now update the two usage sites to use
gsspSetCacheControl.Assistant
Now update
pages-page-response.tsto use the shared module.Assistant
Now fix imports/type in
pages-page-response.ts.Assistant
Now update
pages-page-data.tsto import the type from the new module, andpages-data-route.tsto apply gssp headers.Assistant
Now update
pages-data-route.tsto accept and applygsspRes.Assistant
Now update the generated entry to pass
gsspRes.Assistant
Now re-run the end-to-end verification (dev + prod) with a temp test.
Assistant
The implementation is complete. Let me do a final verification run of the most relevant suites before submitting.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.