We have a scenario where we would like to override an Edge Cache TTL set by a page rule. Is there a way to do this with an origin response header or no? From documentation is looks like CF will always override if it s set via page rule.
We have an Edge Cache TTL defined in a page rule for a specific directory on the site. There is dynamic code that does cache version validation to ensure a stale resource file does not get cached by CFs Edge if the cache validation fails. The validation is needed because we have had issues with bots requesting a page from one server and then requesting resource files from another because they don’t respect our sticky session cookie during our deployments. There are other ways to solve this but this is the path we’re on right now.
We also could set the cache-control max-age in code and disable the edge caching , but we’d prefer to keep it as a CF page rule for simplicity as we have other static resources in the directory that we want cached. Alternatively if there is not a way to override we will look at multiple page rules and not set the edge cache for nested dynamic content.