You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an app with relatively infrequent data updates - updates are usually coming from the currently logged in user. Still I enjoy using swr for ease of use and manage the current users changes through mutate operations without flagging for revalidation. I set deduplication globally to a high value (5 minutes) to avoid unnecessary calls to the backend.
I am looking to completely clear the swr cache when the user logs out, but am having trouble managing this through the undocumented cache feature. It works if I set deduplication to a low value, but my SWRconfig is currently at a top level in my app and does not get refreshed during login/logout (otherwise I might dynamically set config there based on login/logout).
Before I spend a lot of effort reworking something, I am just doing a sanity check. Is there a very easy way to fully clear the swr cache without changing config?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have an app with relatively infrequent data updates - updates are usually coming from the currently logged in user. Still I enjoy using swr for ease of use and manage the current users changes through mutate operations without flagging for revalidation. I set deduplication globally to a high value (5 minutes) to avoid unnecessary calls to the backend.
I am looking to completely clear the swr cache when the user logs out, but am having trouble managing this through the undocumented cache feature. It works if I set deduplication to a low value, but my SWRconfig is currently at a top level in my app and does not get refreshed during login/logout (otherwise I might dynamically set config there based on login/logout).
Before I spend a lot of effort reworking something, I am just doing a sanity check. Is there a very easy way to fully clear the swr cache without changing config?
Beta Was this translation helpful? Give feedback.
All reactions