I have a question regarding the usage of origin-cache control and Edge Cache.
We have added the following cache-control header in our website
cache-control: public, max-age=180, stale-while-revalidate=60,stale-if-error=1800
Based on what I have searched Cloudflare will respect your origin expires / cache control headers to calculate the Edge Cache TTL (providing you don’t override it with a page rule setting an explicit Edge Cache TTL).
While we simulate network downtime to our server we have the following results
Note: the tests below where conducted at the same time.
- If I had previously visited the website recently I get a stale response with the last cached version
- If I visit the website for the first time in a new browser I get a 522 error.
Since the website is cached in the edge of cloudflare should both browsers receive a stale response or edge cache is not respect at all and I get stale from the browser cache?
Below is my page rule of origin cache control: