Replies: 2 comments 6 replies
-
Do you have a custom cache handler for multiple instances of NextJS? I'm a big ignorant to a lot of what Payload does behind the scenes, as I haven't had as much time as I'd like to dig in to the source. I imagine this is an issue related more to NextJS and/or how you're hosting, rather than something specific to Payload, but I could be completely wrong. edit: to be clear, if you are hosting NextJS outside of Vercel, or something that handles everything for you, you should absolutely be using your own cache handler. Without a cache handler, you will face numerous issues, similar, but not limited to what you've described above. |
Beta Was this translation helpful? Give feedback.
-
@hdodov Next.js uses a single cache for everything. If you use multiple processes or servers you have to implement a custom cache. There are a few examples how to do this correctly. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Once we switched to Payload 3, we started experiencing issues, likely due to the nature of React RSC and Next not playing well with our load-balanced AWS environment.
Here is what happens in DevTools after each character I type in a field of a payload global named "sitewide". One time the response is RSC, as expected:
Correct response
…but the other time it's a regular HTML document:
Incorrect response
In the second screenshot, there's
Accept: text/x-component
in the request, but the response hasContent-Type: text/html
. As a result, I end up with errors like this when I try to save the document:I guess this happens because one of the servers has the user state and the other one doesn't.
@jmikrut can you confirm that Payload 3 can't or shouldn't be used with load balancing?
P.S. I know that this has been previously discussed in #6584, but it's about Payload 2, which wasn't based on Next and RSC.
Beta Was this translation helpful? Give feedback.
All reactions