What is the React Query (TanStack Query) stale-while-revalidate strategy?

React Developer Hard

React Developer — Hard

What is the React Query (TanStack Query) stale-while-revalidate strategy?

Key points

  • Stale-while-revalidate strategy serves stale cached data while fetching fresh data
  • UI is updated with fresh data once it arrives
  • Balances performance with data accuracy

Ready to go further?

Related questions