Fetch cache seeded at build time during SSG is not reused at runtime on Vercel #62649
Labels
bug
Issue was opened via the bug report template.
linear: next
Confirmed issue that is tracked by the Next.js team.
Pages Router
Related to Pages Router.
Link to the code that reproduces this issue
https://github.com/Fredkiss3/inconsistent-fetch-cache-during-build-and-start
To Reproduce
/u/5
/u/3
it will show a different value (the same that is shown at build time)Current vs. Expected behavior
Following the previous steps, I expected to have the same values shown at build time and at runtime, meaning that the fetch cache is set and reused at runtime but it doesn't.
If you try building the project locally, you will notice that the data is effectively cached at build time and the same data is reused at runtime. This may be because when running locally nextjs use the folder
.next/cache/fetch-cache
and is correctly seeded at build time, On vercel it isn't considered.Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.3.0: Wed Dec 20 21:31:00 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6020 Binaries: Node: 20.11.1 npm: 10.2.4 Yarn: N/A pnpm: 8.15.3 Relevant Packages: next: 14.1.0 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
App Router, Data fetching (gS(S)P, getInitialProps)
Which stage(s) are affected? (Select all that apply)
Vercel (Deployed)
Additional context
The site is deployed on Vercel.
Also If you have access to Vercel Request metrics, you will notice that the first call to the fetch cache shows a
CACHE MISS
and next requests reuse the cached data :First Request
Second Request
NEXT-3291
The text was updated successfully, but these errors were encountered: