Open lorenzosim opened 1 year ago
I believe that this could be linked with this issue here #52126. This is a pretty big issue, would appreciate some investigation.
Dynamic rendering with cookies is fine, but what I'm talking about here is multiple fetch calls within the same request. Likely the issue is what @zwarunek linked to.
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App Router
Link to the code that reproduces this issue or a replay of the bug
https://codesandbox.io/p/sandbox/fervent-hugle-mcfppg
To Reproduce
Sample page that calls /foo twice on each load, request is not memoized:
Describe the Bug
When using cookies, requests are not memoized. This is particuarly important for the example above: for a logged in user (hence the cookies), we need to show some data in both the title and the page.
In the pages router the above is as simple as the following and that obviously sends only 1 requests:
Expected Behavior
Requests should be memoized.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response