Skip to content
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

fetch() gets revalidates, ignoring cache settings. Next.js 13 #41977

Closed
1 task done
plastic041 opened this issue Oct 27, 2022 · 4 comments
Closed
1 task done

fetch() gets revalidates, ignoring cache settings. Next.js 13 #41977

plastic041 opened this issue Oct 27, 2022 · 4 comments
Labels
bug Issue was opened via the bug report template.

Comments

@plastic041
Copy link

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101
    Binaries:
      Node: 16.18.0
      npm: 8.5.2
      Yarn: 1.22.19
      pnpm: N/A
    Relevant packages:
      next: 13.0.0
      eslint-config-next: 13.0.0
      react: 18.2.0
      react-dom: 18.2.0

What browser are you using? (if relevant)

Chrome 106.0.5249.119

How are you deploying your application? (if relevant)

next start

Describe the Bug

Multiple fetches in the same server component get revalidated whenever any one of them revalidates, whether it's static or dynamic.

For example, if a static fetch(cache: 'force-cache') and a dynamic fetch(cache: 'no-cache') are in the same server component, whenever a dynamic fetch revalidates, the static fetch also gets revalidated.

Expected Behavior

Static data fetch should not be revalidated.

Link to reproduction

https://github.com/plastic041/next-13-fetch-reproduce

To Reproduce

  1. npm install && npm run build && npm run start
  2. open localhost:3000
  3. wait more than 3 seconds(next: { revalidate: 3 })
  4. static and dynamic data shows same time, since they are both revalidated.
@plastic041 plastic041 added the bug Issue was opened via the bug report template. label Oct 27, 2022
@plastic041 plastic041 changed the title All fetch()s gets revalidates whenever any one of them gets revalidated, regardless of cache settings. Next.js 13 fetch() gets revalidates, ignoring cache settings. Next.js 13 Oct 28, 2022
@pierrechevaliercf
Copy link

pierrechevaliercf commented Nov 3, 2022

Same here, cannot even build our app. (we're using appollo to fetch our data)

@plastic041
Copy link
Author

cannot even build our app.

Do you build on Windows? If you do maybe check #41806

@plastic041
Copy link
Author

Work as expected on next@13.2.3. I'm closing this issue.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 2, 2023

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

2 participants