Unfortunately, from the Cloudflare docs, Cache Everything shouldn’t be used when you have login forms, cart, checkout and similar webpages.
Yes, that’s a “normal and expected behaviour” with the cache system, not just Cloudflare cach as far as every other caching system would cache the “logged-in” page or a “shopping cart” page from the “userA” as a .html file and serve it back to every other visitor/userB/userC for the next:
1 year as you selected … to the visitors which already have visited your website
The issue here is, normal users don’t know how to clear their web browser cache, therefore would have trouble using your website/web app.
Kindly, I’d suggest you to:
Use Cache Level: Standard + Use Argo Smart Routing (paid) to speed-up “dynamic content” + Argo Tiered Cache (free)
Or upgrade to a Business plan which offers us to use the Bypass Cache on cookie option
Remove Page Rules (at least disable the one with Cache Everything) and click on the “Purge everything” button to clear all the caches at Cloudflare edge to prevent further issues for your visitors/user/customers.
Ohh got it, I was going for strong cache because I use Load Balancing and it has to cache my website’s files, so it doesn’t have to request them from the origin on every user requests. Also cached files will be served from the users’ nearest datacenters.
And using Page Rules, you can set for specific paths different cache values like Browser Cache TTL and Edge Cache TTL, or even make Cloudflare to respect the HTTP headers for the cache sent from your origin host/Server (configure on the server as you need, then just use the option Origin Cache Control: On).
Nevertheless, due to the PHP web app, may I share a quick tip with you: Tune-up your PHP values a bit at your server/hosting provider/cPanel if you can:
If possible, install and use PHP OPCache.
If you are using PHP 8.0, you can use the benefits of the new JIT feature.
As far as I do not know which kind of app/framework are you using, if it has got an option to connect and levarage the CPU/disk work for your database, kindly use Redis or Memcached.
Related to the web server, again, without knowing which one, try to tune-up it’s configuration file for better performance gain.
In terms of a server, try to use the one with more vCores (if VPS) and SSD/NvME with good internet bandwidth.
And above the all, using Cloudflare provides you more benefits in terms of a security & optimization.
Thanks brother. i have removed the cache everything rules and it’s not braking sessions. i will also consider all the tips and put them in practice i really appreciate.
Only thing is i been struggling on installing Argo Smart Routing on my server and can’t find a good tutorial.
One and only the single click in the Cloudflare dashboard is needed
You can try it for a month and see how it goes.
There is no installation at the origin/server → you are not required and don’t have to use Cloudflare Tunnel (which requires installing cloudflared tunnel on a origin/server) to use Argo Smart Routing.