Pages Router: gssp/getStaticProps responses missing default and user-set Cache-Control…
- User
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.
- Assistant
I’ll trace the Pages Router dev and production GSSP response paths, first checking the local Next.js reference tests/source as required. Then I’ll add focused regressions and keep both server paths in parity.
- Assistant
The repository’s preferred
vpbinary isn’t available in this environment, so I’ll use the equivalent pnpm commands for installation and targeted validation. - Assistant
There’s no
.nextjs-refclone, and the task explicitly forbids network access. I’ll use the repository’s pinned Next.js compatibility fixtures/local dependencies as the behavioral reference and document the relevant upstream test path in the regression comment. - Assistant
The shared production renderer already forwards GSSP headers, but it never supplies the Next.js “never cache” default. The dev path also only recognizes newly named headers, so a GSSP override can be lost when that header existed before dispatch. I’m fixing both seams and covering default plus explicit override in dev and production.
- Assistant
The focused renderer tests now pass, including the default and explicit override cases. I’m running the Pages Router integration file next because it exercises both the Node dev response and the built production response where the CI failures occurred.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.