We are always looking for new and innovative ways to further speed up and optimize your sites. As you may already know, WP Rocket and Kinsta have been fully compatible for a while.

Check out everything you need to know below about using WP Rocket at Kinsta and how it can be an excellent match for you and your clients.

Using WP Rocket at Kinsta

For those of you who aren’t familiar with WP Rocket, it’s a popular all-in-one premium performance plugin for WordPress that offers caching in the first place. We usually don’t allow caching plugins in our environment because they conflict with our built-in caching solution.

However, WP Rocket page caching functionality will automatically be disabled when running on Kinsta servers. As a result, we allow WP Rocket on our platform because there are no longer any incompatibilities.

This allows you to use Kinsta’s caching solution but still take advantage of WP Rocket’s amazing optimization features (we will dive into these below).

Why is caching important? Caching is the process of storing resources from one request and reusing those resources for subsequent requests. Basically, it reduces the amount of work required to generate a page view and decreases the load on the web server. It’s the number one way to negate the delay from the dependency WordPress has on PHP and a database (read more about WordPress vs static HTML).

WP Rocket features

WP Rocket is a powerful and easy-performance plugin—its UI is beautiful while still being simple to use and navigate! Below, we’ll dive into a few of the recommended features you can utilize from WP Rocket to speed up your WordPress site and how it’s synced with the Kinsta environment.

We will also run some speed tests to see which options have the most impact on a live site. Remember that results can vary from site to site, so make sure to test on your own site or staging.

If you’re using a staging site at Kinsta, WP Rocket has whitelisted our URL structure (staging-sitename.kinsta.cloud), which means it will not count as a site against your overall license count. The same goes for running on localhost.

WP Rocket’s main dashboard
WP Rocket’s main dashboard

Clearing cache

Even though caching is automatically disabled in WP Rocket when running on Kinsta, the “Clear and preload cache” option in the WP Rocket menu is synced up with the Kinsta environment. If you clear your WP Rocket cache, it actually clears your entire site’s Kinsta cache instead. How cool is that? As always, you can clear your Kinsta cache from the top right-hand side of the admin bar.

Clear cache
Clear cache

When activating or deactivating a plugin, WP Rocket prompts you to clear the cache. This is advisable only if the plugin adds frontend content, such as a cookie banner plugin.

WP Rocket changes clear cache
WP Rocket changes clear cache

Lastly, clicking on the “Clear and Preload cache” button from the WP Rocket dashboard also clears the Kinsta cache.

Clear cache in WP Rocket
Clear cache in WP Rocket

Cache

As we mentioned earlier, WP Rocket page caching is automatically disabled for sites hosted on Kinsta. Thus, we recommend leaving WP Rocket’s cache settings as is with “Enable Caching for Mobile Devices” – which is the default option coming with WP Rocket 3.16.

File Optimization

Under the “File Optimization” menu, WP Rocket gives you the ability to optimize your CSS and JavaScript files. Let’s dive into each of these a bit.

WP Rocket file optimization
WP Rocket file optimization

CSS Files

  • Minify CSS files remove whitespace and comments to reduce the file size. With this option enabled, we ran speed tests and saw a 0.87% decrease in load time. ⏱ Due to the way CSS works, this could break your site, so make sure to test it. Again, in general, less whitespace and code is a good thing.
  • Optimize CSS delivery eliminates render-blocking CSS on your website for faster-perceived load time. We recommend enabling the Remove Unused CSS feature.
    Read more about this in our in-depth articles on render-blocking CSS and optimizing critical rendering path. With this option enabled, we ran speed tests and saw a 56.36% decrease in load time. ⏱ Remember, though, this is more about perceived load time rather than actual load time.

Remove unused CSS feature
Remove unused CSS feature

JavaScript files

  • Minify JavaScript files removes whitespace and comments to reduce the file size. In the test we ran, this feature had a low impact, as there was little that wasn’t previously minified by the page builder’s developers. However, due to the way JavaScript works, this could break functionality with your plugins or theme, so make sure to test it.
  • Load JavaScript deferred eliminates render-blocking JS on your site and can improve load time. Read more about this in our in-depth articles on render-blocking JavaScript. However, if you aren’t careful, this can also break your site, so make sure to test.
  • Delay JavaScript execution improves performance by delaying the loading of JavaScript files until the first user interacts, such as with a scroll and a click. With this option enabled, we ran speed tests and saw a 33.33% decrease in load time.

If you are a Kinsta customer using the code minification feature built into the MyKinsta dashboard, double-check with support to see if using both options is fine.

As you may have noticed, the impact of features related to minification on performance is small. This is because most themes and plugins now add minified CSS and JavaScript, and related features usually yield little to no change in performance unless the theme or plugin is awfully coded with a total disregard for performance, which is extremely rare. Other techniques, such as removing unused CSS and deferring and delaying JavaScript, make a difference in code optimization.

Media

Under the “Media” menu, they allow you to lazy load your images, videos, and frames. You also have the possibility to lazyload CSS background images and add missing image dimensions.

Let’s dive into each of these a bit.

WP Rocket media optimization
WP Rocket media optimization

Lazy Load

Lazy loading is an optimization technique that loads visible content but delays the downloading and rendering of content that appears below the fold. Enabling the lazy load option can improve actual and perceived loading time, as images, iframes, and videos will be loaded only as they enter (or are about to enter) the viewport, reducing the number of HTTP requests.

  • Enable for images: With this option enabled, we ran speed tests and saw an 8.55% decrease in load time. The impact of such a feature is limited because WordPress core is now adding native lazyload on all images. The slight improvement on the test came from CSS background image optimization.
  • Enable for iframes and videos: WP Rocket has an option to replace a YouTube video with its preview image automatically. This is a powerful option to reduce the impact of YouTube-related files and heavy scripting, which impacts both the loading speed and the page’s web vitals performance.

Check out our in-depth tutorial on lazy loading in WordPress.

Preload

Under the “Preload” menu they give you an option to enable cache preload, preload links, DNS prefetch, and preload fonts. Not all of these will work at Kinsta. But let’s dive into each of these a bit.

Preload settings in WP Rocket
Preload settings in WP Rocket

Preload cache

We don’t recommend this option for sites hosted on Kinsta because it can actually reduce performance by overloading PHP workers.

Prefetch DNS requests

DNS prefetching allows you to resolve domain names (perform a DNS lookup in the background) before a user clicks on a link, which in turn can help improve performance. It is done by adding a rel="dns-prefetch" tag in the header of your WordPress site. We recommend adding prefetch to external requests from your CDN, Google Fonts, and Google Analytics. Here is an example below:

<link rel="dns-prefetch" href="//cdn.domain.com/">
<link rel="dns-prefetch" href="//fonts.googleapis.com/">
<link rel="dns-prefetch" href="//www.google-analytics.com">

This is harder to speed test, but you can rest assured it will help speed up your site.

Preload fonts

If you’re hosting fonts on your own domain and not on an external service like Google Fonts, we recommend adding them to the “Preload Fonts” list in WP Rocket. By preloading fonts in your HTML’s head element, web browsers can download fonts before they are discovered in your CSS file.

Advanced rules

Due to the fact that WP Rocket syncs to the Kinsta environment cache, you can’t use the advanced rules. If you need to exclude a URL or directory from caching or force cache a certain query string, you can always reach out to the Kinsta support team.

Database

Under the “Database” menu, WP Rocket allows you to perform cleanups on posts, comments, transients, and tables.

When combined with our automatic weekly database optimizations, keeping your database clean by removing unnecessary post revisions and transients will ensure your database is working at peak performance.

Database optimization
Database optimization

Post cleanup

It is not uncommon for older sites to have 100+ revisions on their main pages. This is simply due to years of editing and updating content. Let’s say, for example, a site has 700 pages or posts with 150 revisions on each. This would be over 100,000 entries in the database. This takes up storage space, and even with database indexes, this can sometimes harm performance.

WP Rocket gives you the option to delete the following:

  • Revisions
  • Auto-drafts
  • Trashed posts

Check out our in-depth post on how to optimize revisions for faster performance.

Comments cleanup

Similarly to revisions, spam and trashed comments can add to wasted space over time. WP Rocket gives you the option to delete the following:

  • Spam comments
  • Trashed comments

If you aren’t using comments on your WordPress site we recommend simply disabling comments to prevent spam from coming through at all. You then also don’t have to worry about installing spam plugins.

Transients cleanup

Transients in WordPress are sometimes overlooked, but they are very important! In fact, we’ve seen corrupted transient cache completely take down a WordPress site. These are meant to be temporary and so it’s safe to remove them and we do recommend it. If they are needed by a plugin they will automatically be regenerated. WP Rocket gives you the option to delete all transients.

Database cleanup

The database cleanup option reduces the overhead of database tables. However, at Kinsta, we utilize InnoDB instead of MyISAM and therefore, this is not usually needed. InnoDB has been shown to perform better and be more reliable. A big reason to use InnoDB over MyISAM, is to take advantage of row-level locking. This allows your database queries to process faster. If you migrate your WordPress site to Kinsta, this is one of the many optimizations our engineers make on your site.

Automatic cleanup

WP Rocket also gives you the option to schedule automatic cleanup of your database on a daily, weekly, or monthly basis. This is scheduled with a cron job behind the scenes.

CDN

Under the “CDN” menu you can enable a third-party content delivery network. This is really a no-brainer when it comes to performance. They take the load off of your web server while speeding up the delivery of content to your visitors thus making their experience better. Check out why we think every site should be using a CDN.

If you’re a Kinsta client, this menu won’t be needed as the Kinsta CDN is automatically deployed on your site behind the scenes.

We recommend running your WordPress site first through a website speed test tool to confirm all of your assets (JS, CSS, and images) are loading from the Kinsta CDN.

Add your CDN settings in WP Rocket
Add your CDN settings in WP Rocket

Heartbeat

Heartbeat is a WordPress Core API for server-polling. It’s used by many themes and plugins to maintain a stream of connection with your server. This allows WordPress developers to build real-time updates into their products.

Change WordPress heartbeat settings
Change WordPress heartbeat settings

By default, the client-side Heartbeat code runs every 15-60 seconds. Depending on your site and server configuration, frequent Heartbeat server pings may not be necessary.

With WP Rocket, you can reduce Heartbeat ping intervals to 2 minutes or completely disable pings altogether for your site’s backend (WP dashboard), frontend, and post editor.

For most sites, we recommend using the “Reduce Activity” option. Many modern plugins and themes ensure Heartbeat for core functionalities, so disabling it completely could break your site.

Add-ons

Under the “Add-Ons” WP Rocket gives you the ability to add additional services to your site like Cloudflare, Sucuri, Google Analytics, and Facebook Pixel. If you use any of these services on your site, we recommend setting them up through WP Rocket to ensure you are benefiting from the most optimized integration for these services.

If you’re already using other plugins to integrate these services into your site, you can safely remove those plugins after configuring the add-on in WP Rocket.

WP Rocket add-ons
WP Rocket add-ons

Image optimization

The developers of WP Rocket are the same people behind Imagify, one of our favorite image optimization services. If you’re looking for an easy-to-use WordPress plugin for optimizing images, take a look at Imagify. Click to learn more about image optimization and other optimization plugins and solutions.

Image optimization by Imagify
Image optimization by Imagify

Final speed tests

We then ran some final speed tests with everything enabled so you could see a before-and-after. Note: This WordPress site is hosted at Kinsta.

Before WP Rocket

We ran five tests in PageSpeed Insights without WP Rocket.

Google PageSpeed Insights before WP Rocket
Google PageSpeed Insights before WP Rocket

After WP Rocket

We ran a new test in Google PageSpeed Insights with WP Rocket.

Google PageSpeed Insights with WP Rocket
Google PageSpeed Insights with WP Rocket

We also ran a PageSpeed Insights test with edge cache activated on Kinsta. We noticed that the initial server response time improved from ~370ms without edge cache to 30ms. It’s handy when serving an audience from multiple geographical zones.

Google PageSpeed Insights with WP Rocket - Edge cache enabled
Google PageSpeed Insights with WP Rocket – Edge cache enabled

Here is the takeaway from the results above:

  • WP Rocket goes beyond caching options and offers powerful features to optimize CSS and JS files, images, and more.
  • The site we were utilizing for the test is already fairly optimized. However, it still requires some fine-tuning to ensure results and compliance with Core Web Vitals.
  • If you’re using YouTube videos, you could see load time decreases of up to 50% or more. This is accomplished by utilizing WP Rockets feature that replaces YouTube videos with clickable preview thumbnails. This is really handy!
  • In our Google PageSpeed Insights tests, we saw an increase in our score from 69/100 to 100/100. While scores are not as important as overall load times –we discuss this in our article about Google PageSpeed Insights–, Core Web Vitals are part of the latest SEO ranking factor and we saw a big improvement in their grades as well.

As you can see above, WP Rocket makes it incredibly easy to speed up your WordPress site with just a few simple clicks!

Summary

The team at WP Rocket consistently releases new features that directly align with the web performance recommendations we share at Kinsta. We are excited that clients can now use this plugin without additional modifications.

We would love to hear what you think. Do you use WP Rocket? Let us know below in the comments.

Brian Jackson

Brian has a huge passion for WordPress, has been using it for over a decade, and even develops a couple of premium plugins. Brian enjoys blogging, movies, and hiking. Connect with Brian on Twitter.