System Design · Middle · Question 10 of 75
What does Cache-Control: max-age=60, stale-while-revalidate=600 do?
- ✓Correct answer: Fresh for a minute, then the stale response is served while it updates in the background
- 2The response is stored for 60 seconds, then requests are blocked for 10 minutes
- 3The server must respond within 60 ms, otherwise an error is returned
Explanation
The user almost always gets an instant response from cache, while freshness is maintained by background revalidation. The same strategy underlies SWR, TanStack Query and ISR in Next.js.