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
Copy file name to clipboardExpand all lines: docs/src/pages/docs/guides/caching.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,5 +26,7 @@ Let's assume we are using the default `cacheTime` of **5 minutes** and the defau
26
26
- Because this exact data exist in the cache from the first instance of this query, that data is immediately returned from the cache.
27
27
- Both instances of the `useQuery('todos', fetchTodos)` query are unmounted and no longer in use.
28
28
- Since there are no more active instances to this query, a cache timeout is set using `cacheTime` to delete and garbage collect the query (defaults to **5 minutes**).
29
+
- Before the cache timeout has completed another instance of `useQuery('todos', fetchTodos)` mounts. The query immediately returns the available cached value while the `fetchTodos` function is being run in the background to populate the query with a fresh value.
30
+
- The final instance of `useQuery('todos', fetchTodos)` unmounts.
29
31
- No more instances of `useQuery('todos', fetchTodos)` appear within **5 minutes**.
30
32
- This query and its data are deleted and garbage collected.
0 commit comments