Skip to content
Discussion options

You must be logged in to vote

It does get people confused sometimes, which is why I tried to clear that up in a blog post: https://tkdodo.eu/blog/practical-react-query#the-defaults-explained

StaleTime: The duration until a query transitions from fresh to stale. As long as the query is fresh, data will always be read from the cache only - no network request will happen! If the query is stale (which per default is: instantly), you will still get data from the cache, but a background refetch can happen under certain conditions.

CacheTime: The duration until inactive queries will be removed from the cache. This defaults to 5 minutes. Queries transition to the inactive state as soon as there are no observers registered,…

Replies: 7 comments 27 replies

Comment options

TkDodo
Jan 24, 2021
Maintainer

You must be logged in to vote
10 replies
@sahilw-grorapid
Comment options

@TkDodo
Comment options

TkDodoOct 16, 2025
Maintainer

@sahilw-grorapid
Comment options

@TkDodo
Comment options

TkDodoOct 16, 2025
Maintainer

@sahilw-grorapid
Comment options

Answer selected byfardad-dev
Comment options

You must be logged in to vote
3 replies
@TkDodo
Comment options

TkDodoJun 30, 2021
Maintainer

@lukemorales
Comment options

@TkDodo
Comment options

TkDodoOct 22, 2022
Maintainer

Comment options

You must be logged in to vote
3 replies
@TkDodo
Comment options

TkDodoDec 27, 2021
Maintainer

@SAURABH0504
Comment options

@TkDodo
Comment options

TkDodoApr 1, 2022
Maintainer

Comment options

You must be logged in to vote
2 replies
@TkDodo
Comment options

TkDodoFeb 16, 2022
Maintainer

@patricklafrance
Comment options

Comment options

You must be logged in to vote
1 reply
@TkDodo
Comment options

TkDodoMar 13, 2022
Maintainer

Comment options

You must be logged in to vote
8 replies
@synack-ai
Comment options

@TkDodo
Comment options

TkDodoApr 10, 2024
Maintainer

@synack-ai
Comment options

@TkDodo
Comment options

TkDodoApr 10, 2024
Maintainer

@synack-ai
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
15 participants
@fardad-dev@patricklafrance@TkDodo@ivan-kleshnin@trungvose@markomitranic@lukemorales@ibadeeCodes@SangWonyy@hyfdev@mikib0@SAURABH0504@yunjin-kim@sahilw-grorapid@synack-ai