Optimising WP Rocket for WordPress (2021)
After moving to WPhost and the Google Cloud Platform + Fastly, adding WP Rocket is the next biggest boost you can give your WordPress website.
WP Rocket is recognised as the most powerful caching plugin by WordPress experts. But beyond caching, WP Rocket features minimal configuration and immediate results – get a faster website in a few clicks.
For users who want to leverage WP Rocket caching on top of WPhost, WP Rocket needs to create a persistent cache. The plugin effectively dictates that the cache should never get rebuilt unless WP Rocket explicitly tells it to.
In order to hand over control to WP Rocket, we need to enable a feature called WP_CACHE. To enable this, just open a support ticket requesting we enable WP_CACHE.
Below are our best-recommended settings to get the most out of WP Rocket on your WPhost site.
We stress that after saving each of these settings, that you should clear your WP Rocket cache and test the site within an incognito window to ensure the site displays correctly.
- Enable caching for mobile devices. Only create a separate cache file for mobile users if you have a dedicated mobile theme or plugin. Most modern themes are responsive and should work without a separate cache.
- Disable caching for logged-in WordPress users.
- Cache lifespan is completely dependent upon the site’s use case. For regularly updated sites, set a lower lifespan. For those sites that receive infrequent updates, setting a higher lifespan will require fewer times to rebuild the site cache after it has expired. We recommend the default setting of 10 hours.
- Enable Minify CSS files.
- Disable Combine CSS files (not recommended for sites using HTTP/2).
- Enable Optimize CSS Delivery with caution. This option generates critical CSS and helps to prevent render-blocking CSS. However, sometimes it can break the CSS rendering of some sites. If enabled, ensure to test the site within an incognito window to ensure the site displays correctly.
- The Remove Unused CSS feature is in Beta. We’ve experienced mixed results with this option. If you do select this option, we stress that you should test this setting thoroughly to ensure the site displays correctly. We’ve opted to Load CSS Asynchronously on our own sites for now.
Use the LazyLoad feature with caution. Sometimes, this feature is not compatible with other plugins and/or theme page builders and results in performance degradation rather than improvement. Generally, our recommended settings are:
- Enable for images.
- Enable for iframes and videos.
- Check Replace YouTube iframe with preview image.
- Check Add missing image dimensions.
The Preload Cache feature seeks to generate cached pages before a real visitor hits them. This feature is very taxing on servers and often times will degrade overall site performance rather than improve it. Please keep the preload feature disabled.
Leave Enable Preload Links unchecked. This feature works similar to Preload Cache above, and can degrade site performance.
One of the largest contributing factors to slow sites is unnecessary data within the database. Databases can accumulate cruft due to a plethora of reasons such as abandoned shopping carts, post saved draft points, transients and more.
Post Cleanup, Comments Cleanup, Transients Cleanup, Database Cleanup
- Select every option in these sections.
- We recommend choosing a Weekly frequency for auto cleanup.
Because your site is leveraging WPhost’s built-in Content Delivery Network (powered by Fastly), you don’t need to touch this section.
Reducing or disabling the Heartbeat API’s activity can help save some of your server’s resources.
- Typically, the best option is to select Reduce Activity.
If you’re using Cloudflare, Sucuri or other services you can enable better compatibility with them and WP Rocket by enabling those options.