Everytime I call SWR will hit the database?
Answered
Brittany posted this in #help-forum
BrittanyOP
I'm using useSWR inside a component, and I put one console.log inside the function. It's being called a lot of times just by clicking around, because it's in a sidebar. Is it everytime hitting the database to gather new info? Because it's useless for me, the database just refresh every 5 minutes.
Answered by Brittany
Thanks for the answers guys, what I did was using the
dedupingInterval and focusThrottleInterval5 Replies
Northern Wheatear
Actually it is supposed to work like that
If you are fetching data from db using an api route you can implement caching
BrittanyOP
Thanks for the answers guys, what I did was using the
dedupingInterval and focusThrottleIntervalAnswer