-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Closed
Labels
linear: nextConfirmed issue that is tracked by the Next.js team.Confirmed issue that is tracked by the Next.js team.locked
Description
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:42:11 PST 2023; root:xnu-8792.81.3~2/RELEASE_X86_64
Binaries:
Node: 16.13.0
npm: 9.6.4
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.4.7
eslint-config-next: 13.4.7
react: 18.2.0
react-dom: 18.2.0
typescript: 5.1.6
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue or a replay of the bug
https://github.com/richie-south/nextjs-cache
To Reproduce
Clone the provided repo, run commands, check terminal logs for both api and next.
- start api server
npm run api
- start next
npm run dev
Describe the Bug
Next will make multiple fetch requests to the same path on page reload even if docs says they should be deduped.
This happens on dev and production deployment.
if i reload the root page /
i can see in my api logs that it will makes 3 request to my api, having fetch in my RootLayout and generateMetadata.
If i make a reload on other pages, ex /todo
in my provided example, i will get 5 api requests for the same path.
Expected Behavior
I expect the requests to be deduped as illustrated in the docs. So instead of up to 5 requests it should be 1 when no cache is available.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
Other platform
l-you, Willem-Jaap, r0stig, lundborgm, brooman and 27 morelundborgm, franzwarning, MightySCollins and yarikpetrenko
Metadata
Metadata
Assignees
Labels
linear: nextConfirmed issue that is tracked by the Next.js team.Confirmed issue that is tracked by the Next.js team.locked