Next.js Discord

Discord Forum

Single request calling session multiple times for nextauth

Unanswered
Japanese jack mackerel posted this in #help-forum
Open in Discord
Avatar
Japanese jack mackerelOP
Is there anyway to not call session multiple times on a reload? im calling the discord api as part of it and i keep getting rate limited. checking network tab everytime i refresh it makes a call to the /session endpoint like 4 times. how do i make this just 1?

3 Replies

Avatar
You can cache the data so that the /session endpoint returns cached data instead of sending a request again to the discord api.
Avatar
Japanese jack mackerelOP
how would i go about that