How to keep results always fresh (prevent them from going stale)? #230
-
The only way I have found is to set Setting Is there a clean way to effectively set |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
Just set it to a large amount of time that would surpass the life of your users session length.
|
Beta Was this translation helpful? Give feedback.
-
Also, this should have been posted in the Discussions tab. :) I'll convert it to that now. |
Beta Was this translation helpful? Give feedback.
-
Sorry about "issues" vs "discussions". In your example, |
Beta Was this translation helpful? Give feedback.
-
While I see where you're coming from, however at the end of the day, it would eventually need to be transformed into a time duration since the whole thing runs on timers for cache management. This would be quite a bit of library overhead to write where a simple constant in your ReactQueryConfigProvider or custom hook that wraps useQuery would be just fine. |
Beta Was this translation helpful? Give feedback.
-
Actually we can support |
Beta Was this translation helpful? Give feedback.
-
As long as it doesn't create a bunch of complexity or unnecessary KBs, I'm fine with that. |
Beta Was this translation helpful? Give feedback.
-
Here's a PR #232 |
Beta Was this translation helpful? Give feedback.
-
😍 Thank you, @cherniavskii and @tannerlinsley. |
Beta Was this translation helpful? Give feedback.
Here's a PR #232