Loading...
「ツール」は右上に移動しました。
利用したサーバー: natural-voltaic-titanium
7いいね 517回再生

React Query Cache Lifecycle Explained: Fresh, Stale, Inactive & GC

Learn how React Query manages cached data through fresh, stale, inactive, and garbage collection (GC) phases. This quick guide covers:

Fresh data: Immediately usable (no refetch) based on staleTime

Stale data: Marked for background refetch (window focus, remount)

Inactive queries: Unused data awaiting GC via gcTime

Garbage collection: Automatic cleanup of unused cache entries (gcLimit, gcInterval)

Perfect for developers optimizing data caching strategies in React apps!

#ReactQuery #DataCaching #WebPerformance #FrontendDev #ReactJS

コメント