Skip to content

QuizNot attempted

Reading Cache-Control

What does Cache-Control: public, s-maxage=60, stale-while-revalidate=300 do?
1–4 to choose, Enter to submit
Show answer & explanation

Correct answer:

  • CDNs cache it for 60s; for 300s after that they may serve the stale copy while refetching in the background
  • s-maxage=60 applies to shared caches (CDNs) for 60s, and stale-while-revalidate=300 lets them serve the stale copy for up to 300s more while refetching in the background, so users never wait on a refetch.
  • Not browser 60s / CDN 300s: browsers use max-age, which isn't set, and 300 is the stale window, not a freshness lifetime.
  • Not 'nothing cached': public + s-maxage explicitly allow caching.
  • Not 'browser revalidates every 60s': s-maxage doesn't apply to the browser.