#"Too many requests", how to prevent a user from doing too many page refreshes?

4 messages · Page 1 of 1 (latest)

radiant wasp
#

I'm building a dashboard using the Spotify API, I've created the fetching function in a file called data.ts, used it in the page.tsx file of the route and passed down the data to the components of the page as props.
First, is this the correct way to do it?
Then, if the user refreshes multiple times the same page, will this trigger the fetch function every time? This will give a 429 error.

honest gorgeBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

indigo lava
#

You should cache the data so you don't hit spotify's api again and again

radiant wasp