Cloudflare Cache Everything for WordPress: Complete Setup Guide

Cloudflare Cache Everything for WordPress: Complete Setup Guide

Cloudflare is the world's #1 CDN, but you only get its full benefits by subscribing to the Business plan, which is priced at $200. While it does offer Free and Pro plans, these only cache static content (images, CSS, JS, etc.) and not HTML content; consequently, instead of improving page speed across global locations, the site's speed can actually slow down.

For example, suppose your website is hosted on a data center that is close to your main audience and loads in under 200ms.

If you then use Cloudflare CDN, your site might take 300ms to 400ms to load meaning your site's speed effectively decreases.

How to Make Your Blog Load 200% Faster with Cloudflare CDN

The only solution within the Free plan is to use the "Cache Everything" page rule, which allows Cloudflare to cache your site's HTML pages as well.

How Do You Use Cloudflare's "Cache Everything" Feature?

Creating a "Cache Everything" page rule in Cloudflare is very simple; just log in to your Cloudflare account and follow the steps below. Since "Cache Everything" caches everything, we need to create an additional page rule to bypass the WP admin area. Similarly, we also need to bypass wp-login and post previews tasks for which we can create corresponding page rules but the challenges don't end there.

We also need the ability to clear the cache when publishing or updating new posts or when users leave comments; this functionality is only available in the Cloudflare Business plan.

In fact, Cloudflare's Free and Pro plans do not offer features to clear or bypass the cache based on cookies; for that capability, you need to subscribe to the $200 Business plan.

Benefits of Cloudflare's "Cache Everything"

This allows your website to load in under 200ms across the globe. You can see examples of its performance here; it is truly impressive. By using the Cloudflare CDN, you can make your website accessible worldwide in just 200ms for free.

But wait nothing comes for free, and free services often have their downsides. There are several issues associated with using "Full Page Cache" on Cloudflare's free plan.

Drawbacks of Cloudflare's "Cache Everything"

The biggest disadvantage of using the Cloudflare "Cache Everything" page rule is that it caches all of the website's content.

This means that if your WordPress site receives frequent post updates and a high volume of comments, using "Full Page Cache" will cause problems.

Additionally, this method can cache the WordPress admin area and pages intended for logged-in users if the appropriate bypass rules are not configured correctly. Consequently, anonymous visitors might be served pages meant for logged-in users, potentially creating security and privacy issues.

Furthermore, the cache does not clear automatically when new comments are posted or articles are updated; you have to clear the Cloudflare cache manually to reflect these changes.

To automatically clear the cache when publishing new posts, updating old ones, or receiving user comments, you would need to purchase the Cloudflare Business plan, which costs $200.

Alternatively, you could use a Cloudflare plugin, but these often clear the entire cache and do not guarantee that logged-in user sessions will be bypassed correctly.

That is why I decided to create a plugin that could solve all these issues and I have largely succeeded in doing so.

I developed a plugin that allows you to control the Cloudflare cache while using "Full Page Cache" on the free plan.

#1 Best Plugin for Using Cloudflare Full Page Cache with WordPress

Many experts have proposed solutions for this, and numerous webmasters have developed plugins for it, yet each one comes with some drawbacks.

I initially used this plugin on my own website having used it for the past three months after creating it for personal use.

However, I am now sharing it with all of you so that you can benefit from it as well. It is called "WP Cloudflare Cache" and is available in the official WordPress plugin directory. The WP Cloudflare Cache plugin offers the following features:

  • Automatic cache purging
  • Purging cache for specific pages only
  • Purging cache for new posts
  • Purging cache upon post updates
  • Purging cache when comments are made
  • Bypassing cache for logged-in users
  • Setting custom cache expiration times

The plugin's standout feature is that it clears the cache only for the specific page you are updating.

For instance, when you publish a new post on your blog, only the homepage cache is purged. Similarly, if you update a specific post, only that post's cache is cleared, leaving the rest unaffected.

This ensures that updating a single post does not slow down the loading speed of other pages on your website. It is an excellent choice for sites that require regular content updates.

Regarding logged-in users, the plugin bypasses the cache for them; this means that when a logged-in user visits the site, the page is not served from the cache.

Caching applies only when regular visitors access the site, which helps prevent security issues. The plugin also effectively handles the comment system.

When a user comments on a post or you reply to a comment, the cache is cleared only for that specific page containing the comment.

You can download this plugin directly or install it via your website's dashboard. Use this plugin to take advantage of Cloudflare's "Cache Everything" feature for your WordPress site without any issues.

We request that, after using the plugin, you kindly submit a review with the highest rating.

Please also tell fellow bloggers about this plugin and support our work so that we can create more WordPress plugins like this for you.

Be sure to share this article with other bloggers so they can also benefit from using Cloudflare's "Cache Everything" feature for their WordPress site.

Post a Comment

0 Comments