Enable Cloudflare Cache Everything on WordPress

If you are using the WordPress CMS along with Cloudflare for caching your website on Cloudflare cdn then you must know how you can enable Cache Everything on Cloudflare.

This will greatly help your website achieve faster loading speed along with saving you a lots of bandwidth and memory.

Related Posts

What is Cloudflare Cache Everything?

By default Cloudflare cdn caching is set to ‘Standard’, which means Cloudflare will only cache your website static files like css, js and images and not dynamic files like html that is generated using php.

Now unless your website is very dynamic and everything needs to be updated very frequently you can enable Cloudflare cache everything which will basically enable the caching of all the files of your website, from css, js, images to html.

Cloudflare Standard Caching vs Cache Everything

WordPress html is generated through php at the backend which means it requires a lot of memory and bandwidth every time for the pages to be created and served to the users, now Cloudflare cache everything helps in caching the html files thus wordpress doesn’t need to create the page again and again for new users.

Should I Cache Everything in Cloudflare?

If your wordpress website is a blog that is updated once per day or per week then yes you should enable cache everything in Cloudflare, this will help your blog to handle enormous traffic and increase its loading speed.

But if your website is a e-commerce store or woo-commerce store that contains dynamic things that changes per second then no you should not enable cache everything for it, as things like payment process are very dynamic and caching them fully will create problems for users and will result in failed transactions.

Pros & Cons of Enabling Cache Everything in Cloudflare

Pros –

  1. Increase in Page Load Speed
  2. Lowers CPU, Memory and Bandwidth Usage of Hosting
  3. Equal Page Speed throughout the world due to CDN

Cons –

  1. Not suitable for Dynamic Websites.
  2. Need to Purge Cache for every update if Cache everything enabled manually.

Enable Cloudflare Cache Everything using a WordPress Plugin

On wordpress you can install a plugin called Super Page Cache that will help you enable Cloudflare’s Cache Everything properly with proper settings.

With proper settings I mean settings like excluding certain directories, pages, homepage, 404 Pages etc from caching, purging cache on updating or adding new posts, which if you enable cache everything manually then you don’t have the option to do that,

Install Super Page Cache Plugin

The first step will be to install the Super Page Cache plugin on your wordpress website, to do that first log in to your wordpress admin and go to ‘Plugins > Add New’.

In the search bar search for ‘Super Page Cache for Cloudflare’, the plugin is by Optimole. You can also download the plugin zip file from this link here – https://wordpress.org/plugins/wp-cloudflare-page-cache/

Super Page Cache Plugin

You can install the plugin by searching for it or you can upload the downloaded zip file and activate the plugin.

Setup Super Page Cache Plugin

After installing the plugin go to the plugin settings from ‘Settings > WP Cloudflare Super Page Cache’. Now to setup the plugin settings go and log in to your Cloudflare account and select the domain name that you are using.

In the Super Page Cache plugin you have to enter a API Key from your Cloudflare account, so to get that API Key go to – https://dash.cloudflare.com/profile/api-tokens while you are logged in to Cloudflare.

Now scroll down and go to API Keys section, there you’ll get the ‘Global API Key’ option, click on the view button, enter your password and copy the API Key displayed there.

Get Cloudflare Global API Key

After that paste the API Key in the Super Page Cache plugin settings, enter your Cloudflare email address and click on the ‘Update Settings’ button, once saved scroll to bottom and select your domain name and click on the Update Settings button again.

Enter the Cloudflare email and API Key in Super Page Cache plugin

Now the setup should be complete, you can click on the ‘TEST CACHE’ button to test whether the plugin is working and Cloudflare cache everything is working or not.

I would not recommend you to mess with the settings of the Super Page Cache plugin unless you know what you are doing.

Clearing Cache in Super Page Cache plugin – Clearing the Cloudflare cache using the super page cache plugin is very easy. Just go to the plugin settings and click the ‘Clear Cache’ button, that’s it.

Enable Cloudflare Cache Everything Manually

To enable Cloudflare Cache everything manually you have to first log in to your Cloudflare account, once you are logged in select your domain name.

Now go to the ‘Rules > Page Rules’. In page rules click on the ‘Create Page Rule’ button to create a new rule.

First enter the URL of your website without http or https, if you are using www then enter ‘www.mydomain.com’ if you are not using www then enter ‘mydomain.com’. After that at the end of the domain name enter ‘ /* ‘, so it will be like ‘ mydomain.com/* ‘.

After that below pick a setting, click on select and select the ‘Cache Level’ option. On the right side select ‘Cache Everything’. Once done scroll down and click the ‘Save and Deploy Page Rule’ option.

Create Page Rule in Cloudflare

Clearing Cloudflare Cache Manually – To manually clear Cloudflare cache log in to your Cloudflare account and select your domain name. Now on the Right side you will get the ‘Purge Cache’ option, click on it and click on ‘Purge everything’ if you want the whole cache purged.

However if you want to clear the cache of a particular directory or page then click the ‘Custom Purge’ button and enter the URL of the page or directory you want the cache cleared.

Conclusion

And that is how you can Enable Cloudflare cache everything in wordpress using two methods, using a plugin or manually. Enabling Cloudflare’s cache everything will greatly help your website achieve higher speeds and will lower down the hosting cost by a lot.