I have modified my website to allow for all pages to be cached, even if the user is logged in. An ajax request is used to load the user data on every page load meaning i can comfortably cache the html for every single dynamic page and not have the risk of any wires getting crossed.
The issue I have now is that pages like /myprofile and /editpost/123 are being cached and i do not want this. I have a LOT of pages that require this. I also do not want to cache any of the responses for these ajax requests, but i might just route those through a subdomain that cloudflare isnt caching. Either way, I would like to be able to return a custom http header in the response for certain pages that I do not want cached.
So if a user visits /myprofile, cloudflare will first check to see if the response contains “do-not-cache”, or whatever and if it does not, run the page rule. This way i can have server side control over what gets cached and what does not. My site has about 15 sub sections, all of which have their own share of dynamic edit pages that are locked to specific users.