I have implemented similar thing in my nginx server where it serves cached contents from html cache of the site (site is in php-fpm). The static html is only served when user is logged in. To check this i have added an extra simple cookie and added the check in nginx config.
Now I want to implement somthing similar in Cloudflare cache as well. All dynamic (html content) should serve from Cloudflare cache (if a particular cookie is not present).
I have checked the Cloudflare control panel but haven’t found anything that helps. So, I think I may have to use worker for that?
Please give me some hint or direction so I can get started! Have a great day!
Update: What I am trying to do is. Here is psudo code
if logged_in return and fetch from origin as usual endf if ! logged_in cache_all endif