Request Memoization and Full Route Cache Limits #64667
Unanswered
xyera2
asked this question in
App Router
Replies: 1 comment
-
|
Also running into this - any updates? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context: I've got a Next.js app with several
page.tsxfiles (all located within a[lang]directory). Eachpage.tsxfile handles data fetching from various APIs withfetch(langparam is passed to each API call). I want to refresh the data from these APIs on every page every 2 minutes. Also, I want to render these pages on the server every 2 minutes so they could be cached on CDN (to reduce the load on origin). That is why I'm exporting these variables from each page.tsx file:Problem: This setup has worked fine so far for me, but lately I started fetching a LOT of data from those APIs on some pages. I've been getting a lot of
failed to set fetch cache... fetch for over 2MB of data can not be fetchederrors in dev (next dev) mode because of that. However, everything seems to be working fine in prod (next start) and full route seems to be correctly cached.Questions:
page.tsxfile the best approach for my use case? I exported those values because introducing the[lang]directory increased the load on my origin server due to server-side re-renders for every request.Thanks in forward to anyone who responds and tries to help!*
Beta Was this translation helpful? Give feedback.
All reactions