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.codeExpected: "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.
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) using or 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
Let me start by understanding the repository structure and the issue. The issue is about Pages Router gssp (getServerSideProps) and getStaticProps responses missing default and user-set
Cache-Controlheaders.Let me explore the repository structure first.
Assistant
This is the vinext repository (very likely Vinext - a deployment adapter for Next.js). Let me explore the packages directory and understand the structure better.
Assistant
Let's explore the vinext package.
Assistant
Let's look at the source code structure.
Assistant
Let me look at the key files related to the issue. The issue is about Cache-Control headers missing from Pages Router gssp responses. Let me examine the relevant files
Assistant
Let me look at the key files one at a time
Assistant
Now let me examine the pages data route and other related files
Assistant
Let me examine how pages page data is built and how gssp responses flow through the system.
Assistant
Now let me look at the cache-control module
Assistant
Let me check the prod-server and pages-page-response more carefully to understand the data request flow
Assistant
Let me search for where renderPagesPageResponse is called and where the gssp cache control should be applied
Assistant
Let me look at the pages-server-entry.ts where renderPagesPageResponse is called
Assistant
Let me look at the relevant sections of pages-server-entry.ts
Assistant
Let me see the imports at the top of pages-server-entry
Assistant
Let me look at how createPagesReqRes works
Assistant
Let me look at createPagesReqRes in pages-node-compat
Assistant
Let me look at the PagesReqResResponse type
Assistant
Let me see the full createPagesReqRes return value
Assistant
Let me find the data request section in the generated entry code
Assistant
Let me look at the data request section more closely
Assistant
Let me verify the getHeaders method exists on the response object
Assistant
Let me search for the getHeaders implementation
Assistant
Let me see the getHeaders implementation
Assistant
Now I have a clear understanding of the issue. Let me examine the relevant lines in
pages-page-response.tsto plan preciseAssistant
Let me use the correct syntax for the open command.
Assistant
Let me look at the renderPagesPageResponse function's Cache-Control section
Assistant
Now I can clearly see the issue. Let me fix
pages-page-response.tsfirst:- Add
NEVER_CACHE_CONTROLto the import - Add default Cache-Control for gssp
- Add
Assistant
Now let me add the default Cache-Control for gssp
Assistant
Now let me fix the data request path in
pages-server-entry.tsAssistant
Let me look at the exact data request section
Assistant
Let me look at the broader context to understand how this code is generated
Assistant
Let me find where this string block begins
Assistant
Now I'll fix the data request path. The code uses
gsspRes.headersbut the correct API isgsspRes.getHeaders(). Also need to add default Cache-Control.Assistant
I see there's an extra closing brace. Let me fix that.
Assistant
Now let me verify the changes by checking the build. But first, let me see if there are existing tests related to this issue
Assistant
Let me check the pages-page-response test
Assistant
Let me run the existing tests to verify my changes don't break anything
Assistant
Let me run the pages-page-response tests
Assistant
All tests pass. Let me also run the cache-control and pages-router tests
Assistant
Let me also run the deploy test and any broader test suites
Assistant
Let me run the full unit test suite to ensure nothing else breaks
Assistant
Let me verify the
buildNextDataJsonResponsehandles headers properly once moreAssistant
Let me look at the buildNextDataJsonResponse function
Assistant
Let me review all my changes with a diff
Assistant
The diff looks correct. Let me verify all tests pass one final time to be certain
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.