Docs here state that:
You can use React cache to memoize data requests during a React render pass. For example, although the getItem function is called in both layout and page, only one query will be made to the database:
But on this Sandbox, you can see in the logs that it gets called twice.
Tested in both Vercel deployment and locally.
To Reproduce
- Open the sandbox above
- Clear the terminal
- Check the logs
- Refresh the embedded browser
getItemwill be logged twice
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP PREEMPT_DYNAMIC Sun Aug 6 20:05:33 UTC 2023Binaries: Node: 20.12.0 npm: 10.5.0 Yarn: 1.22.19 pnpm: 8.15.6Relevant Packages: next: 14.1.0 eslint-config-next: 14.1.0 react: 18.2.0 react-dom: 18.2.0 typescript: 5.3.3Next.js Config: output: N/A