WordPress Cloudflare server caching

Hi,

Im asking the community to confirm whether or not I am caching my website correctly, and if I am following the correct process when making updates to my site (i.e., disabling page rules, purging and enabling page rules). I followed an article (below) demonstrating how to optimise Cloudflare server caching for WordPress, Cloudflare plugin and setting up page rules.

Article link: https://www.wppourlesnuls.com/en/setup-cloudflare-to-cache-wordpress-pages/

I have also followed this article for setting up litespeed cache plugin:

Article link: https://webspeedtools.com/litespeed-cache-cloudflare/

It has improved results on GTmetrix, but only for https://asgardcleanrooms.com. I get a bad result for http://asgardcleanrooms.com. Is that normal?

Since setting up the caching between Cloudflare and litespeed, it has changed my worklow. Im just not confident that its correct. Now I have to enter Cloudflare > enable Development mode (Cloudflare) > disable the three page rules (set up in Cloudflare) > disable litespeed caching. Then I can make updates.

After making updates, I purge everything (from Cloudflare plugin) > enable litespeed caching > purge everything (via litespeed plugin) > disable development mode (Cloudflare) > enable 3 page rules.

Can anybody confirm that this process is ok? I ask because one day I noticed after visiting the website that the WordPress tool bar was visible, even after logging out. Naturally, I began to worry if people could access the dashboard. So I disabled the toolbar in my user profile, as recommended in the article.

NOTE: I have enabled the ‘Automatic Cache Management’ in Cloudflare plugin. But, it doesnt seem to show the updates immediately. Refer to articles provided re how I have litespeed cache, Cloudflare plugin and Cloudflare configured.

So to reiterate my quetions below:

  1. Is my workflow (outlined above) correct when logging into the dashboard and making updates in WordPress?
  2. How can I ensure that nobody can see the WP tool bar without disabling it? I like the WP toolbar!
  3. Is it ok to purge everything after an update, even if its just adding one post? (Can I update individual pages, how does it work?).
  4. Does it make a difference if I purge everything i.e. does it effect site performance? Or is that best practice?
  5. Essentially, am I caching my website correctly using Cloudflare (as stated in the article above), Cloudflare plugin and litespeed cache plugin (also as stated in an article above).

Does anybody follow the same process and cache their site like this?

I appreciate anyone taking the time to read this, helping and offering advice.

Server: Cloudflare server
Caching plugin: litespeed plugin
Other plugin: Cloudflare
Cloudflare Configuration: https://www.wppourlesnuls.com/en/setup-cloudflare-to-cache-wordpress-pages/
Litespeed Configuration: https://webspeedtools.com/litespeed-cache-cloudflare/
website: https://asgardcleanrooms.com

Hi,

tldr; Giving personalized advice based on your configuration is beyond the scope of this community. You should familiarize yourself with the new Cache Rules, and replace your Page Rules with them. Make sure you’re using the latest version of Cloudflare plugin. Also, familiarize yourself with the way your origin caching plugin works.

I don’t think so. You should not rely on a workflow that forces you to manually purge cache every time there are changes to your content. You should instead find ways to do it automatically using whatever tools you have access to (Cloudflare, origin server config, WordPress settings, plugins etc.)

You mention Automatic Cache Management (which has been renamed Auto Purge Cache on Update.) It should do for you what you are doing manually. But that’s contingent on a whole lot of other variables, mainly how you set your cache at your origin and at Cloudflare.

If you need to enable Development Mode to make updates, it probably means you are over-caching, e.g. caching backend resources and files when just the frontend should be cached.

You can try to exclude paths beginning with /wp-, which is easy to do using Cloudflare Cache Rules. See if that solves the problem. This may also be at the root of your Cloudflare plugin taking some time to show updated content (though I’m just guessing here.)

The WordPress toolbar issue you can also correct with a Cache Rule, by adding a condition based on Cookie does not contain wordpress_logged_in. This will make sure your visits to your own site will be DYNAMIC. If you want to see what other visitors see, you should use incognito mode.

That depends a lot on what content you publish, and several settings of your website. If you publish a news website where every page needs to contain the latest headline, you may need to purge all pages when the main headline changes. Most websites are not like that.

Of course it affects performance. But again, this decision depends on what your content is, and what do you prefer to accomplish (performance vs up-to-the-minute content).

2 Likes