Stale content served when server is down

I am seeing this problem requesting a resource in a worker like so:

const marker = await fetch(new Request(“host2.app.mydomain.net”));
headers.set(‘xage_’, marker.headers.get(‘age’))
headers.set(‘xCC__’, marker.headers.get(‘Cache-Control’))
headers.set(‘xstat’, marker.status)

The worker serves custom domain app.mydomain.net. If server for the resource being requested is down (TCP reset is returned), these are the headers:

xage_: 69338
xcc__: max-age=1
xstat: 200

You could think of default caching rules, and so did I. My take on it:

(ends_with(http.host, “mydomain.net”))
Edge TTL: respects Origin
Do not serve stale content while updating: On
Origin error page pass-thru: On

I think I could rely on Age header to detect this abnormal behavior in my worker. But I thought I’d better be having another pair of eyes in case I am seriously missing anything in rapidly changing feature-set.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.