API route called multiple times
I have a page which calls an API route once:
However on the server side it's logging as three separate requests. This is bad because in my server I'm calling an external API and it's getting me ratelimited. Any ideas how to only call my API once?
7 Replies
then you probably have three calls. hard to tell without more info
consider caching the result on the server side / in the api though?
i can assure you i have one call
well when the bot joins a server the info will be outdated so i cant really cache
the page itself loads two times
that could be updated via webhook in theory 😄 but just some ideas
the page itself loads two timesWhy?
i dont know
@manniL / TheAlexLichter okay so it only seems to do it when im on the page then i restart
console errors? most likely hydration problems. see https://www.youtube.com/watch?v=TYyEjN0UrfA
? but it only happens when i first start the project
after that they load fine
On reload
The video should help