Does stale-while-revalidate
work if the URL is purged via the API, or does it only work if the URL expires based on s-maxage
value?
For example. If I have a page that is cached by Cloudflare with the following response header.
Cache-Control: max-age=0 s-maxage=14400 stale-while-revalidate=300
If I then purge that page via Cloudflare’s API.
The next request to that URL will make Cloudflare re-fetch from origin. In-between Cloudflare fetching from origin and caching the response, another request is made for that URL. Will Cloudflare serve the stale version? Or does that only happen if the cached response expires “naturally” (ie. after s-maxage=14400
)?