How to clear cache and query properly? #2311
Unanswered
intelcoder
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am having trouble with react query because it keep caching header.
I didnt wnat to cache anything so I have set up like this.
As I understand it should not cache anything but it does.
When I am using useQuery, I also pass auth token.
when user log out, It should not have token but it uses cached version so it always logout user.
I tried to invalidate all the queries or used clear().
What is the best way to clear all the caches on log in and out?
Beta Was this translation helpful? Give feedback.
All reactions