Replies: 1 comment 2 replies
-
|
We have hit the same issue and found that reason for it that bundle for API routes would be separate to bundle for pages, so we have 2 instances of the same code and classic JS singleton approach doesn't work. We are exploring usage of It is couple years passed since your post @omgMath , do you have answer to it by any chance? |
Beta Was this translation helpful? Give feedback.
2 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.
-
Hi
We've a
next.jsapp running. To avoid unnecessary requests to the CMS, we've implemented a cache, which we clear after changes in the CMS by calling a routeapi/clear-cache.Simplified version: This route basically takes a exported, already instantiated class
Cacheand clears it.On the other side, when sending a request to the CMS, we await the response and store that in the same exported, already instantiated class
Cache.For debugging purposes, I've added a UUID to the
Cacheinstance, and it shows:api/clear-cache: Clear cache with id: b5583b47-9eef-4cd1-a0ad-b24508ee1e71getStaticProps(withrevalidate: 20): Get from cache with id: fcbe712a-e4ab-4789-a3a8-4b925754a329I don't really understand what is happening and hoped someone of you could make sense of it...? Are there some child processes spawning? Does someone see how to solve it?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions