Inconsistent caching behavior of "unstable_cache" for some Cosmos DB operations #79394
-
SummaryOur website displays application data to users. We’ve implemented two GET functions that cache their results using unstable_cache from Next.js:
Here is the code:
Under the /apps route, we use the following component:
This renders links to all apps and calls both appsGet() and appGet().
Issue: This version always queries the database instead of using the cache. Version 2 – Using appGet()
This time when I access the app which is cached in other component: await appGet("027fb347-5eee-4223-8696-648210c97215"); it gets the data from the cache it doesn't go to the database. So my questions are: How can I use the cache from appsGet in the dynamic route component? Why I can use the cache from appGet, but not from appsGet in dynamic route component? Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi, what next.js version are you using? |
Beta Was this translation helpful? Give feedback.
-
When I set canary version it shows me that we hit 2 MB cache limit. This is why the cosmos operation which return more than 2 MB is not cached. I found a solution #48324 |
Beta Was this translation helpful? Give feedback.
When I set canary version it shows me that we hit 2 MB cache limit. This is why the cosmos operation which return more than 2 MB is not cached. I found a solution #48324