How to Reduce CPU Usage from the WP Rocket Plugin

Heads up: This page may include affiliate links. Read the full disclosure.

The WP Rocket plugin is a commonly used solution for full-page caching, minification, and CDN integration. The plugin has two features that can contribute to higher CPU usage on the site’s server if used without changes to the default settings.

WP Rocket - High CPU Load

1. Preloading Resources

The first feature is preload, this is when the cache is created based on a sitemap of the site. First, make sure to adjust the cache lifetime to a more extended period, such as 24 hours this will mean that the cache does not have to be regenerated so frequently.

The preload feature has parameters that can be adjusted using the filters in the WP Rocket plugin to adjust the batch size, the interval between batches, and the delay between the requests.

It is also possible to set up a cron job to clear the cache and preload, which is more relevant if the site has low traffic for periods.

2. Remove Unused CSS

The second feature that can lead to higher CPU usage is the Remove Unused CSS feature. Generating the used CSS can increase CPU usage, but if you are using at least version 3.12 of the plugin, then it has parameters in the filters in the plugin’s core that can be modified.

The parameters allow the pending jobs cron rows count to be adjusted, allowing for fewer requests at a time, and increasing the pending jobs cron interval will allow for more time to process between requests.

The preload and Remove Unused CSS features have helper plugins that can be adjusted, installed, and activated on the sites where the WP Rocket plugin is used.

Using the minify JS and CSS and the combined CSS feature can contribute to higher CPU usage and can be disabled if you notice that it is affecting your site’s server. If many JS and CSS files need to be minified, it can increase CPU usage.

If the Remove Unused CSS feature is enabled, the combined CSS feature will be greyed out in the WP Rocket settings. If the site server has HTTP/2 or HTTP/3 enabled, it is unnecessary to combine CSS files into one single CSS file.

The helper plugins for WP Rocket are easy to modify for both the preload and the Remove Unused CSS features to make those adjustments and then deploy those fixes to all of the connect child sites.

Useful Links

0 thoughts on “How to Reduce CPU Usage from the WP Rocket Plugin”

  1. Our CSS and JS hardly ever change, there should be an option to disable the automatic regeneration, or check the last modified date. The server is suffering from all the rebuilding every time.

Looking for something?

Privacy laws apply to businesses that collect personal information. Since no personal information is collected by the MainWP plugins, no privacy laws apply to the MainWP plugins. This includes GDPR, UK DPA 2018, PIPEDA, Australia Privacy Act 1988, LGPD, PIPL, and other privacy laws.
Donata Stroink-Skillrud
Donata Stroink-Skillrud
President of Agency Attorneys

Your Download Is Just One Click Away

…or just download the plugin.

By entering your email, you agree to our Terms of Service and Privacy Policy.