Skip to content

Commit af5f77b

Browse files
committed
add cache mode descriptions
1 parent 2c625cf commit af5f77b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,22 @@
1+
/*
2+
stale-if-slow (default) — equivalent to previously used renewQuery: false
3+
If refresh keys are up-to-date, returns the value from cache
4+
If refresh keys are expired, tries to return the value from the database
5+
Returns fresh value from the database if the query executed in the database until the first “Continue wait” interval is reached
6+
Returns stale value from cache otherwise
7+
8+
stale-while-revalidate — AKA “backgroundRefresh”
9+
If refresh keys are up-to-date, returns the value from cache
10+
If refresh keys are expired, returns stale data from cache
11+
Updates the cache in background
12+
13+
must-revalidate — equivalent to previously used renewQuery: true
14+
If refresh keys are up-to-date, returns the value from cache
15+
If refresh keys are expired, tries to return the value from the database
16+
Returns fresh value from the database even if it takes minutes and many “Continue wait” intervals
17+
18+
no-cache — AKA “forceRefresh”
19+
Skips refresh key checks
20+
Returns fresh data from the database, even if it takes minutes and many “Continue wait” intervals
21+
*/
122
export type CacheMode = 'stale-if-slow' | 'stale-while-revalidate' | 'must-revalidate' | 'no-cache';

0 commit comments

Comments
 (0)