Skip to content
public-library›Rules›TanStack Query›Set staleTime from how fast data changes

Set staleTime from how fast data changes

Set a client-wide default staleTime above zero, and override it per query based on how quickly that data changes and how much outdated data would matter. Leave gcTime at its default unless you have a specific reason to change it.

In the full rule