Stale-While-Revalidate
Noun · Development
Definitions
A caching strategy (HTTP header and React Query/SWR pattern) that immediately returns stale cached data while simultaneously fetching a fresh version in the background. Users see content instantly (from cache), and it's silently updated moments later. Provides the speed of aggressive caching with the freshness of no caching.
In plain English: Showing cached content immediately while fetching the latest version in the background — fast AND fresh.
Example: "SWR returns the cached user profile instantly and refetches in the background — the user sees data immediately and it updates if anything changed."