Cloudflare-CDN-Cache-Control, APO & stale-if-error

Our site uses APO. I am setting custom Edge Cache TTL using the Cloudflare-CDN-Cache-Control at the origin for certain types of content based on some custom logic on our side.

In my Cloudflare-CDN-Cache-Control header, I’m sending max-age and stale-if-errror.

I read on these forums that stale-if-error is built into APO. If that is true, what is the default stale-if-error duration? If I send max-age via Cloudfare-CDN-Cache-Control, does the default stale-if-error duration persist? And I assume I can send a different value for stale-if-error if I want to change the default?


It is true, as documented. Please check the APO FAQs here: FAQs · Cloudflare Automatic Platform Optimization docs

This hasn’t been documented anywhere I could find.

Though APO will ignore Cache-Control from the origin (see FAQs), sending Cloudflare-CDN-Cache-Control or CDN-Cache-Control directives is a documented way of fine tuning your caching under APO. (Documented perhaps in a non-intuitive place. Please check the last paragraph here: Page Rule integration with APO · Cloudflare Automatic Platform Optimization docs)

1 Like

The question is specifically about stale-if-error. I hope someone on the Cloudflare team who knows can document this for us.


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