Enabling HTML Cache in CloudFlare

Cloudflare is a type of free CDN to protect your server from attacks and make your website faster and with a more robust cache. In this article we will teach you step by step how to further improve your speed with Cloudflare HTML Cache.

Natively the CloudFlare does not save HTML Cache, but it is possible to activate this function and obtain a much greater and almost instantaneous speed in the loading of your page. Just be aware that this function can bug some themes and things on the site, so test it before activating it.

Enabling CloudFlare HTML Cache

To enable HTML Cache in Cloudflare, simply access the Page Rules tab in your CloudFlare dashboard and create a new rule that covers all domains or subdomains, select Cache Level and choose the option Cache everything. Just add as in the image below:

Ativando cache de html no cloudflare

By doing this, just save and clear the CloudFlare cache to apply the new rules, now your website will work with HTML cache and will load the pages almost instantly.

Cloudflare HTML Cache Issues

One of the little mistakes I noticed is that if you keep it activated on wp-admin of WordPress, you may be in danger of opening a code editor or outdated article and saving it. So always update the page a second time or clear the cache before editing it.

Another problem is that sometimes the WordPress admin bar does not appear. It didn't happen to me, but if for some reason the wp-admin toolbar is showing up for people not logged in, just disable it via a code on function.php.

Despite these small sacrifices, I think it is worth activating the HTML cache, your site is much faster. Perhaps with a few settings and adding exceptions to Page Rules you will be able to use this function without any problems.

To avoid problems with your Wp-Admin, you can disable the HTML Cache by creating another specific rule for the part / wp-admin/ from the website. So you can use the HTML Cache in Frontend no problem.

Solving 301 Problem

We previously wrote a problem related to 301 redirect which can also be resolved with a Page Rules. Unfortunately if you enable HTML Cache this problem also returns.

An alternative is to activate the HTML Cache only in its HTTPS version without WWW. which is an easy thing to do, but I believe leaving out your subdomains. As the free version of CloudFlare only allows 3 active Page Rules, we recommend using it wisely.

Enabling your site's HTML Cache will help you get a 90+ on PageSpeed. Remembering that we made an article speaking as objective 90+ on mobile with Adsense.

Ativando cache de html no cloudflare