The cache serves the stale copy immediately and fetches a fresh one in the background. max-age=60 makes the copy fresh for 60 seconds. stale-while-revalidate=30 adds 30 more seconds. In that window, the cache may answer instantly with the stale (out-of-date) copy while it revalidates in the background. Revalidate means the cache asks the origin server if the copy is still good, or gets a new one. At 75 seconds the copy is inside this window.
"The cache blocks the request until the origin returns a fresh copy" is wrong at 75 seconds. That only happens after 90 seconds, when the copy can no longer be served stale. Then the request waits for revalidation. "The cache deletes the copy because max-age has passed" is also wrong: a stale copy is kept and revalidated, not deleted.
Backend question · HTTP & API design › Headers & HTTP caching
A response is sent with Cache-Control: max-age=60, stale-while-revalidate=30. A cached copy is now 75 seconds old. What happens on the next request?
The cache serves the stale copy immediately and revalidates it in the background
Read more