First of all I don’t have ‘Always on’ enabled and I am using Argo tunnel to connect to my local machine for testing. Also I thought this would be a simple thing to understand but I can’t seem to find a solution.
Let’s say my origin serves a file
/ostrich.png with header
cache-control: public, max-age=30.
cf-cache-status: HIT response up until when 30 seconds has passed and then it will refresh the resource.
I then take my server completely down.
After 30 seconds I’m seeing
cf-cache-status: STALE instead of an expected 5xx origin error message. There’s a 2 second delay as it makes an attempt to connect and fails.
This is the behavior I would want if I had set
stale-while-revalidate but I didn’t set that header for this resource. The help says:
The resource was served from cache but is expired. Cloudflare couldn’t contact the origin to retrieve the updated resource.
But I don’t want this. I want an error if the server is down after the resource has expired. The behavior I’m seeing is effectively the ‘Always on’ behavior without the banner.
I originally was trying to implement
stale-if-error but without setting either of those options I’m effectively getting an infinite time serving stale resources. What am I missing?