When using Super Page Cache for Cloudflare along with WP Rocket plugin it is highly recommended that you do not use more than one page caching system on your site as that will lead to compatibility issues and problems.
Whether you have a server level page caching system or some other page caching plugin installed in yoru site, you need to ensure that all page caching mechanisms are disabled on those plugin before using the Super Page Cache for Cloudflare plugin on your website. Also, ensure that there is no server rule in your .htaccess
file or nginx.conf
file which is modifying the cache-control
header value of the page as that value needs to be managed by the Super Page Cache for Cloudflare plugin.
Here is what you should do if you are uising WP Rocket along with Super Page Cache for Cloudflare to get the best results.
First make sure that both WP Rocket and Super Page Cache for Cloudflare are disabled on your wensite and inside your wp-config.php
file there is no WP_CACHE
constant. If you see a statement like define( 'WP_CACHE', true );
or something similar inside your wp-config.php
file, please delete that line and save your wp-config.php
After this README documentation you will file another file named wp-rocket-no-cache.php
file attached to it. Make a copy of that file in your system either by downloading the file or creating a file with the same name and copy poasting the content given below.
After that open your FTP client and go to /wp-content/mu-plugins/
folder. Inside /wp-content/
if you do not see the mu-plugins
folder, just create a new folder and name it mu-plugins
. Then inside this folder put the mu-plugin code given below.
Finally, when you go inside yoru WP Admin > Plugins
section, now you should see that a new Must Use Plugin
section has been added and under which this WP Rocket - No Cache plugin is mentioned. This will ensure that you have done this step right.
Now enable the WP Rocket Plugin and make sure page caching or mobile device caching is disabled inside this plugin. After enabling WP Rocket, open the FTP cleint again and open wp-config.php
file. This time there should not be any mention of the WP_CACHE constant.
Similarly, when you would go inside the /wp-content/
folder, there should not be any advanced-cache.php
file as well.
You can use WP Rocket to optimizing your static files like CSS/JS etc. or you may use other plugins dedicated to static file optimization like Autoptimize. For image optimization, there is Cloudflare Polish (comes with Cloudflare Pro plan and above), Imagekit, Optimole, Shortpixel, EWWW Image Optimizer etc.
But this gist is for those who must need to use WP Rocket.
Now it is the time to enable the Super Page Cache for Cloudflare plugin, enter the Cloudflare API details and enable page cache. After this, everything should work fine without any major issues.
Hi @fedeandri,
You see, Super Cache for Cloudflare is a Page Caching plugin. Now to explain your questions first you need to understand what page caching is. It simply means a system that caches the HTML pages generated by server-side languages like PHP at the disk level so that when another user request the same thing, instead of generating the page HTML again through PHP, instead the cached HTML will be returned to the user.
So, this is why it is crucial to ensure you have only one page caching system in place for any site. So that none of them conflict with one another. You can definitely use a separate plugin for static like optimization if you want to cause that has nothing to do with page caching.
Now you can have page caching in multiple ways. You can have WordPress plugins that cache the page at the disk level, you can also have server-side tools like fast-CGI cache or varnish cache which does the same thing at the server level without the help of WordPress system or PHP.
Now when you have multiple page caching systems it creates a wired loop of confusion. Also not to mention each of these page caching systems does things in a different way. So, when you have a multiple page caching system in place, whichever wins the war of handling the request will return the response with the cached HTML along with whatever Response Header it sets. This
Response Header
is a crucial thing in terms of both disk-level page caching and CDN-level page caching.Imagine you in a multiple-page caching system in place. At this time when a request comes and the server starts processing the request, at this time the server might not know what to do, i.e. whether to process the request via PHP or checked the cached HTML and return that. At this time, imagine a war is going on between all the page caching systems you have in place to see who will get to handle/process the request.
So, at this time whoever of them wins will get to cache/process the request. Also not to mention this creates a nightmare of cache purging as god knows who gets to cache what, at what point in time. Moreover, most importantly depending on which caching system is handling the request the
Response Header
will be set accordingly. And without the proper response header that is set by the plugin, Cloudflare caching will not work properly and you will have issues caching/purging cache.In the end, Super Page Cache for Cloudflare comes with a multi-tier caching system. First, it caches pages in Cloudflare global CDN and along with that it also has a
Fallback Cache
which is a traditional disk cache there as a fallback for the time when the cache is expired in Cloudflare CDN, instead of executing PHP to generate the page, the page HTML can be served from the disk level fallback cache.So, I hope now it is clear to everyone why it is important to have only one page caching system on any website. You can have any page caching system you like, but try to keep only one page caching system. Otherwise, things will conflict, cause issues, and will waste server resources.
This is a devastating combination. Firstly I don't know how anyone can use the Super Page Cache for Cloudflare plugin with the page caching off as it is a literal page caching plugin which you cannot turn off. It just comes with two flavors of page caching. First is the Cloudflare global CDN page caching which is enabled by default and then secondly the traditional fallback cache which is disabled by default and users need to manually enable it.
You can use any combination you want, but it is not something that I will recommend. If I was in your place, here's what I would have done:
Perfmatters
which is not a caching plugin but rather optimization plugin including static file optimization.But again at the end of the day you can do whatever that pleases you.