Hi,
first of all, it seems like you are mixing the other approaches that you have used before this plugin, with this plugin. Please note that before using this plugin, inside your Cloudflare dashboard > page rule section, make sure there are no page rules related to modifying cache behavior, time, or things like that. If you have page rules for redirection or something that’s fine.
Then after you install this plugin it will auto-add 1 page rules (that’s all it needs) and then set the rest of things up on its own.
Now coming to Ajax, the plugin doesn’t cache ajax requests and always makes sure that ajax requests are bypassed from the cache. This is the default behavior. You don’t have to add any page rule or stuffs like that for it to work: https://i.imgur.com/lZRiImE.jpeg
So, based on what you said, it should work right out of the box.
Now coming to the static file. First, make sure that you do not have any expire rule already added in your .htaccess
or server rule for static files. Then enable the browser cache for the static file option inside the plugin. If you are in a .htaccess
based server it will automatically add the best cache control rule for your static file. If you are in an Nginx server, it will show you the rule and then you need to add them.
Screenshot: https://i.imgur.com/paX4AAk.jpeg
P.S.: If you have an eCommerce like site where normal users gets to login and do things, it’s recommended that you use the Worker Mode (screenshot: https://i.imgur.com/2nDxv9S.jpeg) rather than the default page rule mode — which works really well for blog/portfolio like sites where the user won’t login to do anything like that.
-
This reply was modified 2 years, 7 months ago by
iSaumya.