Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching headers are presented in Dev mode while missing in Prod mode #11046

Closed
SZharkov opened this issue Mar 13, 2020 · 2 comments
Closed

Caching headers are presented in Dev mode while missing in Prod mode #11046

SZharkov opened this issue Mar 13, 2020 · 2 comments
Labels
Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation.
Milestone

Comments

@SZharkov
Copy link
Contributor

Bug report

Describe the bug

Cache-control header is presented in response when working in dev mode. In prod mode this header is missing. I was also trying to set headers manually using custom express server before sending a response res.set("Cache-control", "no-store, must-revalidate") but it didn't make any change.

To Reproduce

Steps to reproduce the behavior:

  1. yarn create next-app
  2. yarn dev - check response headers
  3. yarn build, yarn start - check response headers

Expected behavior

Cache-control header is presented in both dev and prod environments.

Screenshots

image
image

@SZharkov SZharkov changed the title Caching headers are present in Dev mode while missing in Prod mode Caching headers are presented in Dev mode while missing in Prod mode Mar 13, 2020
@Timer Timer added this to the 9.3.2 milestone Mar 13, 2020
@Timer Timer modified the milestones: 9.3.2, 9.3.3, 9.3.4 Mar 27, 2020
@Timer Timer modified the milestones: 9.3.4, 9.3.5 Apr 3, 2020
@Timer Timer modified the milestones: 9.3.5, 9.3.6 Apr 15, 2020
@Timer Timer modified the milestones: 9.3.6, 9.3.x Apr 28, 2020
@valmassoi
Copy link
Contributor

I'm having the same issue. X-Cache-Expired-At and X-Cache-Status(from ssr-caching example - cacheable-response package) are there locally in dev mode but missing when deployed to prod. Did you figure something out @SZharkov

I dropped back to version 9.3.0 to fix this
#12019

@Timer Timer modified the milestones: 9.x.x, backlog Jun 15, 2020
@timneutkens timneutkens added the Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation. label Nov 18, 2021
@pascuflow
Copy link

Just opened #40275 which looks similar, its been 2 years, any progress?

@vercel vercel locked and limited conversation to collaborators Apr 17, 2024
@balazsorban44 balazsorban44 converted this issue into discussion #64630 Apr 17, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation.
Projects
None yet
Development

No branches or pull requests

5 participants