You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if there is a way to know inside getServerSideProps if it is currently being used used to SSR the page, or if it is being called from the client as an AJAX request.
My particular use case I have quite an expensive operation that I only want to do on the initial SSR. For subsequent calls from the same client I don't want to redo the same operation as it will likely return the same result, so I have cached it on the client.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I was wondering if there is a way to know inside getServerSideProps if it is currently being used used to SSR the page, or if it is being called from the client as an AJAX request.
My particular use case I have quite an expensive operation that I only want to do on the initial SSR. For subsequent calls from the same client I don't want to redo the same operation as it will likely return the same result, so I have cached it on the client.
Beta Was this translation helpful? Give feedback.
All reactions