I currently have “cache everything” page rule disabled, but when i had it enabled this was my configuration:
Page rule - Cache Everything (www.mydomain.com/*)
That was the only page rule i configured. The EDGE TTL page rule was not used.
I had also configured Caching > Browser Cache Expiration > “Respect Existing Headers”
Using this configuration, if a page received a 403 response, and then i visited that page again, the 403 page would be cached as shown by CF-Cache-Status=HIT
This is the response header from the 403 page given out by Siteground. Cache everything page rule is not enabled. I have no control over these response headers. Siteground support were unable to add any cache headers.
Cache Everything Enabled
If i enable the “cache everything” page rule, this is the response header i get for a repeated view of a 403 page. EDGE TTL page rule is not used.
stephane, as i was putting this all together to explain the issue clearly to you i made a discovery that solved the problem.
I added the page rule “Origin Cache Control” and set this to on.
The only other page rule i had enabled was “cache everything”
When i visited the 403 page again, cache is now being bypassed! Success!
Strangely, there is no no-cache header present. So i’m not sure what’s making it to be bypassed, but it is no longer being cached.
My 410/404 pages output a no-cache header, so Cloudflare does not cache this which is what would be expected. But again, why the cache is being bypassed on the 403 page when it doesn’t have a no-cache header, and when “Origin Cache Control” page rule is enabled, i don’t know?
Could you please confirm for me that with my current settings Cloudflare will not cache error pages? I am unsure why the 403 is being bypassed without having a no-cache header. Do you know why?