Cloudflare documents a list of directives for the Cache-Control
header, including stale-while-revalidate.
- stale-while-revalidate=<seconds>
When present in an HTTP response, the stale-while-revalidate Cache-Control extension indicates that caches MAY serve the response in which it appears after it becomes stale, up to the indicated number of seconds since the object was originally retrieved.
I set my Cache-Control
header to public, max-age=0, stale-while-revalidate=30
but I never seem to get a cache hit. Does Cloudflare actually support this?
If you put max-age=0
, then effectively nothing is cached, if so, then there is nothing to serve. Try with max-age=1
- that should give some results in that 30 sec. period.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With