-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is the default gcTime of 5 minutes too long? #9
Comments
Maybe two solutions are needed:
|
The argument in the other direction is generally TanStack Query has more aggressive defaults (like refreshing every query when the tab becomes active again) and once you start to tweak for performance and costs you dial these down, so something aggressive is nice. And that this way global changes to the default gcTime will be reflected in queries https://tanstack.com/query/latest/docs/framework/react/guides/important-defaults#:~:text=By%20default%2C%20"inactive"%20queries,1000%20*%2060%20*%205%20milliseconds. |
I think a decent stop gap is to update the document with a Defaults section that describes the use case and let the user think about changing the gcTime! What "cache" actually means etc. |
Here's where that might go, plus the README here https://docs.convex.dev/client/tanstack-query#differences-from-using-fetch-with-tanstack-query |
With @convex-dev/react-query the default
gcTime
of 5 minutes [edit: maybe] isn't appropriate because it means continuing to receive updates for a query for 5 minutes. This could be a problem especially if e.g. subscribing to a new query on keystroke, but even in normal cases it's potentially a lot of extra function executions for queries that update frequently.The text was updated successfully, but these errors were encountered: