WordPress

How To Enable CloudFlare’s Cache Everything For WordPress

CloudFlare is a very powerful CDN that is free but doesn’t lack in features. It can make your site fly like a rocket and reduces your load time dramatically. This is done by caching static resources on your site and by default they cache many different resources such as CSS/JS/PNG/ETC and there is a way to tweak this setting even more.

Cache everything is a page rule in CloudFlare that is both dangerous but also separates your site’s load time from everyone else. The tool will break all non-static content as its meant to save html pages in it’s cache.

The upside to this feature is it can reduce your TTFB to less than 200MS and it completely offloads your site to CloudFlare’s networking reducing server load dramatically. The downside is that anything that requires login or authentication will no longer work.

If you are using a paid tier you disable it for logged in users by checking for cookies but if you are on the free plan there will be trade offs. Enabling this feature is quite easy and works beautifully if you use your WordPress website as a means to post news or blog posts.

Go into your CloudFlare account and go to the page rules tab. You will need to create three page rules as followed and in the specific order (if you place one broad page rule above the others it will override their effect).

Page Rule #1

Domain: *yoursite.com/wp-admin*

Settings: Cache Level: Bypass

Page Rule #2

Domain: *yoursite.com/wp-login*

Settings: Cache Level: Bypass

Page Rule #3

Domain: *yoursite.com*

Settings: Cache Level: Cache Everything

If you have placed it in this order you will still be able to login and CloudFlare will begin caching static HTML on your website. Your website’s load time will be decreased dramatically

Tags
Show More

Scott Hartley

Scott Hartley is the developer and owner of The Daily Exposition who is also a tech enthusiast and writes the majority of content found on the website. When he isn't keeping up to date with the latest and breaking technology news, he is working on his own WordPress plugins, themes, or out exploring the world.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Close