Skip to content

Commit

Permalink
Update x-nextjs-cache header in minimal mode (#36791)
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed May 9, 2022
1 parent db8f161 commit 7d52589
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/server/base-server.ts
Expand Up @@ -1629,7 +1629,7 @@ export default abstract class Server<ServerOptions extends Options = Options> {
return null
}

if (isSSG) {
if (isSSG && !this.minimalMode) {
// set x-nextjs-cache header to match the header
// we set for the image-optimizer
res.setHeader(
Expand Down
2 changes: 2 additions & 0 deletions test/production/required-server-files.test.ts
Expand Up @@ -188,6 +188,7 @@ describe('should set-up next', () => {
redirect: 'manual',
})
expect(res.status).toBe(200)
expect(res.headers.get('x-nextjs-cache')).toBeFalsy()
const $ = cheerio.load(await res.text())
const props = JSON.parse($('#props').text())
expect(props.gspCalls).toBeDefined()
Expand All @@ -201,6 +202,7 @@ describe('should set-up next', () => {
}
)
expect(res2.status).toBe(200)
expect(res2.headers.get('x-nextjs-cache')).toBeFalsy()
const { pageProps: props2 } = await res2.json()
expect(props2.gspCalls).toBe(props.gspCalls)

Expand Down

0 comments on commit 7d52589

Please sign in to comment.