I’m considering using “Cache Everything” for my whole domain by a single Page Rule.
However, I have a few pages on my site that use PHP and need to avoid being cached.
In that case, is there any problem if I just use php cache-control headers on those pages to avoid cache for the PHP route?
More info here.
Cloudflare docs state we shouldn’t use Cache Everthing for pages like the “login” page. But why can’t we if we then use PHP headers to specify that we don’t want to cache that specific page within the site?
Also, my PHP routes won’t include .php extension. They can be .html or even directories /. So I can’t use the solution proposed in this other issue.
That is a good question and something I suggest you simply try it out.
Generally, sending cache-control: no-store should prevent Cloudflare from caching, however I cant tell how the proxies react with an explicit “cache everything” rule.
It could be a bit risky. Should Cloudflare cache it for whatever reason, you will have to purge it manually or wait until it expired as it wont send the request to the origin any longer in the first place.