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 response path in dev and production, first checking the local Next.js reference tests/source as required. Then I’ll add focused regression coverage and implement header propagation/defaulting in both paths.
- Assistant
vpis not installed in this environment, so I’ll use the repository’spnpmcommands for installation and targeted validation. - Assistant
rgis also unavailable, so I’m falling back tofind/grep. The worktree status is clean. - Assistant
The repository already has most custom-header forwarding in place, but the framework default is never attached. I also found that production data responses and HTML share a mutable gSSP response object, so applying the default immediately after gSSP returns will cover both without duplicating response logic; dev needs the equivalent treatment.
- Assistant
I’m going to centralize gSSP header application in the typed Pages response helper and reuse it from the generated data-response wiring. This keeps the production HTML and
/_next/datapaths aligned, while the dev server gets the same default at the point it captures Node response headers. - Assistant
The focused helper tests pass. I’m now running the actual Pages Router fixture checks in dev and production, including the newly asserted default and override behavior.
- Assistant
Both HTML and
/_next/dataregression checks now pass in dev and production. I’m doing the repository’s format/lint/type validation next, then I’ll review the final diff for unintended changes.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- fable-5Compare side by side →
- fable-5Compare side by side →