how to invalidate all cache? #1991
peterweb2005
started this conversation in
General
Replies: 2 comments
-
Invalidating "all" the cache is not something you truly want to do. If you want to update a provider every few seconds, you can do: FutureProvider((ref) {
final timer = Timer(duration, (_) => ref.invalidateSelf());
ref.onDispose(timer.cancel);
return fetchWhatever()
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
can it invalidate without refresh? my currently protential solution, update all timestamps, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
thanks
case:
my app need always update (may be in interval), as other users may updated their created content
so, i need to create a timer hook, and on event invalidate all cache,
so, how to invalidate all cache?
actually, my current situation, every request has a time argument,
when i update the time argument (with provider then notify), the content with attached provider will refresh
thanks
Beta Was this translation helpful? Give feedback.
All reactions