Caching Comparisons: WP Rocket vs. SG Optimizer

Storyware has specialized in building high performing WordPress applications for many years now. We take a variety of steps to ensure that each site we launch loads quickly, offering a smooth user experience. Some of these performance enhancing steps taken by Storyware include the installation of caching plugins.

What is Caching?

Before we dive into which caching plugins we use, let’s talk about caching. Caching is a technique that stores a copy of a given asset in a reserved location and then serves the asset in a more efficient manner. These assets can be in the form of entire web pages, or individual files loaded by a web page. Proper caching results in much faster load times, and increases how much traffic a website can handle.

The importance of caching on WordPress sites

WordPress is notorious for slow page load times out of the box. Without a caching system in place, each page load on a WordPress application can easily result in dozens of database queries. Proper caching ensures that the database is only queried when necessary due to content changes, or fetching dynamic content.

Caching plugins typically avoid numerous database queries per load by serving pre-compiled static HTML files to users. These static HTML files are generated from the PHP files when content changes are made, or when the cache is flushed programmatically. This is a big performance win and will greatly increase the amount of traffic that a WordPress application is capable of handling. We cannot stress enough how important caching is on a WordPress site.

Our Preferred Caching Plugins

We use two caching plugins on the majority of our WordPress websites: WP Rocket and SG Optimizer. Each plugin has unique features, hence why we use both. Here are some of the key features of each plugin:

WP Rocket Features

Storyware began using WP Rocket in 2014, and has since installed the plugin on every WordPress site built by Storyware. WP Rocket offers the following features:

  • GZIP Compression
  • File based caching at the browser level, with preloading options
  • Minification and concatenation of scripts and styles
  • Lazy loading of assets
  • CDN Integration
  • Heartbeat API Control
  • Database Optimizations
  • Google Analytics and Facebook Pixel script optimizations

SG Optimizer Features

We began recommending SiteGround as a hosting platform to our clients a few years ago. Now, most of our clients host their WordPress applications on SiteGround. The SiteGround platform offers robust caching capabilities via their SuperCacher System. WordPress applications must run the SG Optimizer plugin to take full advantage of the SuperCacher system. Note that a website must be hosted by SiteGround in order to run the SG Optimizer plugin.

SuperCacher allows WordPress applications to take advantage of the following features:

  1. NGINX Direct Delivery: Caches all static content on websites. Any images or assets that must be served from the server are able to be stored in the server’s RAM. It’s much quicker to access resources held in RAM as opposed to an SSD.
  2. NGINX Dynamic Cache: This caches your entire website, including dynamic content, and serves the cache via NGINX. With our dual caching system, WP Rocket’s file based cache acts as a backup for this.
  3. Memcached: Leverages the server’s RAM to store data and objects, reducing the number of database queries. Since we use WP Rocket to serve static HTML pages, this particularly benefits any API driven requests, cache preloading, or any actions performed by site administrators.

Like WP Rocket, SG Optimizer also offers the following features:

  • GZIP Compression
  • Caching at the browser level
  • Minification and concatenation of scripts and styles
  • Image optimizations
  • Lazy loading of assets

Caching Setups Compared

With each new cache implementation we have seen visible improvements in page load times. We have also seen our websites hold up incredibly well under heavy loads of traffic. But what are the true numerical differences in page speed when comparing no caching, WP Rocket, SG Optimizer, and a combination of the two plugins? We decided to find out by using the popular GT Metrix tool on our very own Storyware website.

We opted to use our staging website instead of the live site, but both are hosted on SiteGround. At the time of testing, our staging site was running on one of SiteGround’s cloud servers with WordPress 5.5.1, and PHP 7.4. The majority of our image assets are served from an Amazon S3 Bucket via Cloudfront. It’s very rare that we deploy a WordPress application that self hosts media content these days.

No Caching

First up, let’s see how the Storyware website performs without any caching enabled. We disabled all caching plugins, and also disabled the NGINX Direct Cache feature from within the Site Tools panel of SiteGround.

GTMetrix ratings without Caching

As you can see our PageSpeed score is an 83, Y Slow is 73, and our full load time is 4.8 seconds. This leaves much room for improvement.

The report also points out that we have a number of images on our website which must be optimized. Failure to fully optimize media files prior to uploading to the web is one of the biggest performance bottlenecks that we see. Thankfully, this can easily be fixed either manually or with a plugin such as Smush.

WP Rocket

Next we tested the site with just WP Rocket enabled. We stuck to the basic features, and did not use any of the asset minification since we handle that in our development cycle.

WP Rocket GTMetrix ratings

WP Rocket didn’t drastically change our PageSpeed score, but our YSlow rating went 11 percentage points and our load time decreased by 1.3 seconds. This is a big improvement!

SG Optimizer

Our third test featured just the SG Optimizer plugin enabled. We enabled Memcached, Dynamic Cache, and NGINX Direct Delivery.

SG Optimizer GTMetrix ratings

Our PageSpeed score is the same as when WP Rocket was enabled, the page load time is 0.2s faster than WP Rocket, but the YSlow score is 4 percentage points worse than WP Rocket. Diving into the YSlow score shows that without WP Rocket, many assets are served with un-necessary cookies. This rating decrease due to assets with cookies is not a massive performance issue and can be largely ignored.

SG Optimizer and WP Rocket

Last but not least, we tested the combination of WP Rocket and SG Optimizer with the same basic options enabled for each as we did in the tests above. This variation is the setup that we run on each of our client sites.

GTMetrix ratings with SG Optimizer and WP Rocket enabled

The PageSpeed and YSlow scores are both 84%, the same as with just WP-Rocket enabled. The page load time is 1 second faster than without any caching, but 0.5s slower than with just SG Optimizer plugin enabled. We would need to do some more research to see why the combination of the two plugins resulted in a slightly slower page load time, but it’s also possible that this was just a variation in server response time.

Which Caching Setup is Best?

Any caching setup is likely going to be better than no caching, but based on these results you will see great improvements on your WordPress with either WP Rocket, SG Optimizer, or a combination of the two. We will continue to keep using both plugins for our clients who host their sites on SiteGround thanks to the unique features of each plugin, and the “backup” cache scenario that is created by the combination. For those sites that are not running on SiteGround, we would strongly recommend using WP-Rocket.