Next.js Discord

Discord Forum

Fire-and-forget methods in getServerSideProps

Unanswered
tyteen4a03 posted this in #help-forum
Open in Discord
Is it possible to have fire-and-forget methods in getServerSideProps that does not block page loads? I would like to trigger a Relay mutation during page load but don't want it blocking the rest of the render.

1 Reply

technically it is possible but you can not guarantee the upstream transaction has complete as the connection could be terminated, especially when instances are running on AWS Lambda, where connections won't last so long. Self hosting could be okay but still you would need error handling.