Cache folder is getting too big
In some cases, WP Rocket optimizations can exceed the disk or inode limits set by your hosting provider. This article lists which folders can be affected, the features that cause the problem in each folder, and how to solve the issue in each case.
Problem happens at wp-content/cache/min
This indicates an issue with the Combine JavaScript files feature. The /wp-content/cache/min/
folder will be full of JavaScript files.
A common issue is with the Combine JavaScript files option. We optimize inline JavaScript by default and if your site contains dynamic JavaScript, that is code which varies slightly from page to page, this will trigger a lot of files to be created.
Solutions
The possible solutions are turning off the Combine JavaScript files option, or exclude the problematic, dynamic Inline JavaScript, as shown below:
- Enable the Delay JavaScript execution feature, as this is the most powerful JavaScript optimization.
When Delay JavaScript execution is active, the Combine JavaScript files feature is automatically deactivated for compatibility reasons.
This is the recommended solution because it avoids the cache folder size issue while optimizing the site further. - If you can't use the Delay JavaScript execution feature, you would need to exclude the affected script from the Combine JavaScript files feature instead.
Please read this guide to identify which specific Inline JavaScript is causing the problem. - Alternatively, you can deactivate the Combine JavaScript files feature if your site uses HTTP/2 because combining files is not necessarily recommended.
Note that if the folder already has an excessive number of files in it, you may have to manually remove them via FTP. After doing that and disabling Combine JavaScript files, the problem should resolve.
Problem happens at /wp-content/cache/wp-rocket/used-css/
The Remove Unused CSS feature stores the resulting Used CSS files in the /wp-content/cache/wp-rocket/used-css/
folder.
WP Rocket optimizes the disk usage by detecting pages that can share the same Used CSS file, and by storing the Used CSS files with the GZIP extension.
However, if your site has too many pages with unique CSS, the space and inodes of this folder can grow a lot.
Solutions
You can fix this problem by deleting the content of the /used-css/
folder, and by limiting the Remove Unused CSS coverage, like this:
- Disable the mobile-specific cache to deliver the default (desktop) cache mobile visitors. This will reduce the number of Used CSS entries to half.
In WP Rocket versions older than 3.16, you can disable Separate cache files for mobile devices feature.
Note: This approach is only recommended if your theme is fully responsive, and you don't have any mobile-specific content on your site. - Use the Conditionally Disable Remove Unused CSS approach.
Problem happens at /wp-content/cache/wp-rocket/yourdomain.com/
The Page Caching automatic feature can trigger a disk or inode limit error as it stores the cache files and their respective sub-folders in the cache folder, at /wp-content/cache/wp-rocket/yourdomain.com/
.
Solutions
The solutions to this problem is to clear the cache folder, and limit the pages or conditions under which this feature works:
- Disable the mobile-specific cache to deliver the default (desktop) cache to mobile visitors. This will reduce the number of cache files to half.
In WP Rocket versions older than 3.16, you can disable Separate cache files for mobile devices option.
Note: This approach is only recommended if your theme is fully responsive, and you don't have any mobile-specific content on your site. - Disable the WebP Compatibility as this Add-on will duplicate the number of cache files. For example, you can switch to one of the two Imagify methods to serve WebP images.
- Disable the User Cache option, or disable Page Caching for logged-in users while keeping only the optimizations on.
- Disable Page Caching for specific pages and posts.
- Deactivate Page Caching on all pages except for the selected URLs.