Stale-While-Revalidate (SWR)
A caching strategy that returns cached data while fetching updated data in the background.
Also known as: SWR, Stale while revalidate
Category: Concepts
Tags: software, caching, patterns
Explanation
Stale-While-Revalidate (SWR) is a caching strategy where cached (potentially stale) data is returned immediately while fresh data is fetched in the background. This provides instant response times while ensuring eventual consistency. The pattern is used in web development and CDNs. Conceptually, it applies to knowledge work: sometimes acting on slightly outdated information is better than waiting for perfect information. The key is knowing when staleness is acceptable and ensuring updates happen.
Related Concepts
← Back to all concepts