Cloudflare is the best and number one CDN in the world but its 100% benefit is only on taking its business plan, which is priced at 200$. Although it also provides Free and Pro Plan, but it only caches Static content (Images, CSS, JS etc.) and not HTML content, it slows down the site speed of the site in many places worldwide.
For example, If your website is hosted on India based data center hosting (like DigitalOcean) and is open under 200ms in India.
Now if you use Cloudflare CDN, then your site will be open in India from 300ms to 400ms, meaning the speed of your site will be slow.
The only solution in the free plan is that you can use Cloudflare cache everything through the page rule, so that Cloudflare can also cache your site’s HTML pages.
How to use Cloudflare Cache Everything?
Creating a page rule with cloudflare cache everything is very easy, for this you go to your Cloudflare account and follow the steps below.
Because cloudflare caches everything when using cloudflare cache everything, so we have to create another page rule to bypass the wp admin area.
Right now we need to also bypass wp-login and post preview which we can create the same page rule, but the problem does not end here.
Because right now we will need to publish or update a new post and clear the cache for comment users, which is possible only in cloudflare business plan.
Actually, cloudflare does not offer cache clear or bypass for cookies in free and pro plan, it requires a business of $ 200.
Benefits of cloudflare cache everything
This makes the website load your website in less than 200ms worldwide.
This is also really great, you can open your website in a worldwide location in just 200ms for free using Cloudflare CDN.
But wait, everything is not available in free and there is a problem with free things too. There are also many problems with using full page cache in the cloudflare free plan.
Disadvantages of Cloudflare Cache Everything
The biggest disadvantage when using the Cloudflare cache everything page rule is that it clouds all the content of the cloudflare website.
Meaning that if regular posts are updated on your WordPress site and there are lots of comments, then there will be a problem if you use full page cache usage.
Also, using this method, WordPress admin area, logged in user are also cached. This causes anonymous visitors to be logged in page survey, so that they can access your website admin area.
Apart from this, cache is not clear even when new comment comes on post / pages or updating the article, to do this manually cloudflare cache has to be cleared.
Cloudflare business plan will have to be taken to publish new posts on your blog, update old posts and automatically clear cache for comment users, for which you will need to pay $ 200.
Or you can use the Cloudflare plugin for this, but it clears the entire cache, and does not even guarantee to bypass logged in user.
So I thought of creating a plugin that could solve all these problems and I have been successful in it to a great extent.
I created a plugin that allows cloudflare cache control when using full page cache with Cloudflare free plan,
1. Best Plugin for use Cloudflare Full Page Cache for WordPress
Many experts have told its solution and many webmasters have also made many plugins for this, but all have some problems with it.
So I first used this plugin on my website, I have been using it for the last 3 months, although I made this breaking for personal use.
But now I am sharing it with all of you so that all of you can also take advantage of it, their name is WP Cloudflare Cache which is also available on WordPress Official Directory.
The WP Cloudflare Cache plugin provides us with the following features.
- Automatic purge cache
- Purge only specific page cache
- Purge cache for new post
- Purge cache for post update
- Purge cache for commenting
- Make bypass all logged in user
- Setup custom cache expire time
The biggest feature of this plugin is that it clears the cache only for the page that you update.
For example, when you publish a new post on your blog, only the cache of the homepage of your block will be purge. Similarly, if you update a post, only that cache will be clear or not.
The advantage of this will be that upon updating one of your posts, the speed of the rest of the website pages will not slow down. This means that it is best for regular content update site.
Now it comes to the logged in users, the plugin bypasses all logged in users, meaning that there will be no page cache when the logged in user opens the site.
There will be page cache only when visitors open the site. This will also not cause a security problem. Similarly, the plugin comment system also solves the problem.
When a user comments on a post on your website or if you reply to a comment, the cache will be clear only for the page containing that comment.
Use this plugin and avail the cloudflare cache everything feature for your WordPress site without any problems.