State While Revalidate
State While Revalidate is an HTTP cache invalidation strategy popularized by HTTP RFC 5861.
- display the data from cache if available (stale),
- send a request for new data (revalidate)
- display the up-to-date data
This kind of model works with simple HTTP queries and does not need advanced tooling such as the one from Firebase to keep data up date.
For example SWR library from Next.JS uses events such as change of tab, network reconnection, out of sleep and timers to fetch data from time to time and keep the display fresh.