Pages Are Not Cached or CSS and JS Minification Are Not Working
If you believe that WP Rocket is not caching your pages or is not minifying your CSS and JS files, it might be that the minimum requirements for the plugin to function have not been met. Or it could be that you have previously installed other caching plugins, and even if you deleted them via the WordPress dashboard, they have left files and configuration behind.
In order to function correctly, WP Rocket needs the following:
- WP-config.php needs to be writeable.
Make sure that the following line is present at the top of the file, after the opening <?php tag. If it is too far down in the file, it WILL NOT WORK!
/** Enable Cache by WP Rocket */ define( 'WP_CACHE', true );Make sure there is no reference to another caching plugin. For example, Super Cache leaves behind the following:
define( 'WPCACHEHOME', '/path-to-your-wordpress-install/wp-content/plugins/wp-super-cache/' ); //Added by WP-Cache Manage
Make sure that the
wp-content/cache folder has
writing permissions and that there are 2 folders within it:
/min and /wp-rocket
Both need writing permissions.
If these folders don't exist you should manually create them.
If you have previously enabled any other caching plugins, they may have left behind their own folders.
Within the wp-content/cache folder, the only 3 folders WP Rocket creates are /min, /busting and /wp-rocket. All others should be removed.
Super Cache also creates a wp-cache-config.php file within wp-content which should be deleted.
W3 Total Cache creates the following within wp-content which should be deleted:
- folder: /w3tc-config
- files: object-cache.php, db.php
and it creates these folders within wp-content/cache which should be deleted:
It may create others based on your settings.
- Check that your .htaccess file is writeable
- Make sure advanced-cache.php, in the wp-content folder references only WP Rocket
- Make sure a folder named wp-rocket-config is present in wp-content. If not, create it and make sure it has writing permissions
- If you have a multisite installation using domain mapping, try logging into your admin area using the mapped domain instead of the original domain, and then de-activate / re-activate WP Rocket. This will enable WP Rocket to detect the right domain and activate caching.
Sometimes another plugin may set the constant
DONOTCACHEPAGE. What this does is override all caching plugins by blocking caching from working. So this would need to be removed and the developer of that plugin informed.
Two common plugins that add a DONOTCACHEPAGE constant are s2 Member and WooCommerce Klarna Gateway.
You can see if this is what's causing the problem by installing this mini-plugin:
Force Page Caching
This will override a DONOTCACHEPAGE constant.
- If you're using SSL on your website, make sure to check the SSL Cache option under Settings -> WP Rocket -> Basic Options tab.
NOTE: As of v2.7, if you're running your site under HTTPS, the SSL Cache option should be auto-activated and not removable. After making any of these adjustments,
de-activate and re-activate WP Rocket.
Then you can verify if WP Rocket is working by following this article:
Other server requirements
mod_deflateshould be enabled (ask your webhost to enable these)
- No restriction on the tmp folder
- curl_exec function should be enabled