Next.js Discord

Discord Forum

Can We Revalidate Client Side Fetch?

Unanswered
Carpenter wasp posted this in #help-forum
Open in Discord
Carpenter waspOP
I Want to revalidate Tag Client Side Fetch

3 Replies

@Carpenter wasp I Want to revalidate Tag Client Side Fetch
Sun bear
You can fetch the data via tanstack query with useQuery. Then you can invalidate the query or use refetch
your talking about using fetch on browser, you would need to manually re-run the fetches with no cache: https://developer.mozilla.org/en-US/docs/Web/API/fetch#cache (or use SWR/react query to make nicer hooks arround it - but that still assumes that browser isnt caching)