LiteSpeed Cache vs. WP Super Cache

June 10th, 2019 by LSCache 12 Comments

LiteSpeed Cache vs. WP Super Cache

If you are stuck on choosing a cache plugin for your WordPress site let’s make things a little bit easier for you. Today we are comparing the features and costs of LiteSpeed Cache for WordPress and WP Super Cache. We’ll talk about how each plugin works, and then we’ll share a side-by side comparison of features.

LiteSpeed Cache vs. WP Super Cache

Let’s start by discussing each plugin’s caching capabilities, ecommerce compatibility, premium services, and costs.

Caching

Both plugins provide full-page caching for WordPress. Page caching is essential for a WordPress site, as it allows static snapshots to be generated and saved for the dynamically-generated page. It’s significantly faster to server static content than it is to wait for WordPress and PHP to assemble content dynamically. Most WP pages are exactly the same each time they are built, so using these snapshots makes sense, and delivers a much-improved user experience to the site’s visitors.

How Caching Works

Generating a page cache for WordPress is not always straightforward. Some sites have significant customization or areas of private content, which means a single cached copy of each page will not be enough to cover the needs of every visitor. Both LSCache and WP Super Cache have ways of addressing these scenarios, some of which are more effective than others.

WP Super Cache

WP Super Cache provides three methods of page caching: Simple, Expert, and WP-Cache.

The Simple and Expert methods produce what they call “supercached” static HTML files, while WP-Cache produces a sort of hybrid that allows for some dynamic content to be included on the page.

WP-Cache is mainly used to cache pages for logged-in users, those who leave comments, or those who will have private content displayed on the page. It can also be used to cache feeds, and URLs with parameters. It is the slowest caching mode of the three.

Expert mode makes use of rewrite rules in a site’s .htaccess file. It completely bypasses PHP and serves “supercached” static HTML. This is the fastest WP Super Cache mode.

Simple mode is similar to Expert in that it serves so-called supercached files, however rewrite rules are not involved. The content is served instead by PHP. The plugin authors recommend using Simple mode as it is easier to set up than Expert mode and doesn’t involve editing .htaccess, though it does result in serving content more slowly than in Expert mode.

Caching with LiteSpeed

LiteSpeed Cache is a lot like WP Super Cache’s Expert mode, but with one important difference: the plugin is not actually doing the caching. The basic LSCache functions are carried out by LiteSpeed Web Server’s built in cache module. The plugin is provided as an easy way for WordPress to communicate with the cache engine, but it doesn’t execute any of the caching tasks, and the cache files themselves are not stored within the WordPress file structure.

Like WP Super Cache’s Expert mode, LiteSpeed Cache uses .htaccess rewrite rules and completely bypasses the use of PHP. It is preferred to avoid PHP because of its expensive overhead.

LiteSpeed can cache private content for logged-in users, and can include dynamic content on otherwise static pages, similar to WP Super Cache’s WP-Cache mode, but more flexible. We’ll go into more detail about how each plugin does this when we discuss eCommerce, although the concepts apply to any area of your WordPress site, not just shopping carts.

Purging Cache on Demand

Both plugins require you to specify an expiration time or TTL (Time to Live) for content. This is a default number of seconds that cached content is considered fresh. Sometimes, though, content must be purged from the cache before it reaches its natural expiration.

WP Super Cache

If a post is modified or a comment is posted, the static HTML copy of the post page is automatically deleted. Admin users may also choose to manually delete the entire cache.

LiteSpeed

LiteSpeed, too, purges the static HTML copy of any post that has been modified, but it also goes a step further. Because of the plugin’s tight integration with the server on one end, and with WordPress on the other, LSCache remembers things about the cache entries that other plugins cannot, and it is able to act efficiently when content changes. When content is created or edited and must be purged from the cache, LSCache uses a tag-based system to identify related content that must also be purged. In this way, there is never too much or too little removed from the cache. It is also possible to manually purge the entire cache or a single page, if desired.

Handling Expired and Purged Cache

No matter which plugin you use, there will be a cache directory on your server that continually fills up and takes up space. Let’s look at how each of the plugins cleans up after itself.

WP Super Cache

With WP Super Cache, you set a schedule for garbage collection. A job runs on the specified schedule, deleting expired static HTML files from the cache directory.

LiteSpeed

LiteSpeed’s garbage collection works differently. Because tags are tracked and stored in shared memory, the server has an efficient way of determining when a page needs to be deleted from cache. When the LiteSpeed server receives the purge header, it simply marks the related tags as “purged” but does not actually delete the files on the file system. This is to avoid heavy disk I/O while serving the response.

LiteSpeed Server will deal with the outdated entries during non-busy CPU cycles and delete files in small batches with minimum side effects.

Cache Varies

Both plugins allow multiple public cache versions of a single page, for certain situations.

WP Super Cache

WP Super Cache has support for mobile browsers. If you have a non-responsive desktop theme and are using a separate theme for mobile traffic, you can enable this option to have two copies of each page stored in cache: one for desktop visitors, and one for mobile.

LiteSpeed

You can have multiple cache copies (aka “cache varies”) in LiteSpeed as well, but it is more sophisticated than simply mobile vs. desktop. LiteSpeed’s server-side cache engine allows it to use vary cookies to serve multiple versions of cached content based on things like geographic location, cookie, and user group. There is enormous flexibility in the LiteSpeed cache vary system.

Cache Preloading and Rebuilding

WP Super Cache and LiteSpeed Cache both have the ability to preload the cache. Cache crawlers traverse the site, caching any pages that are not currently cached, and minimizing the possibility of a visitor having to wait for any pages to be dynamically assembled.

Wp Super Cache

WP Super Cache’s crawler simulates an unknown user on a desktop computer. If Cache Rebuild is enabled, garbage collection is turned off while the crawler runs so that an existing supercache file may be served to visitors on very busy sites while a new file is being generated.

LiteSpeed

LiteSpeed Cache’s crawler also simulates a non-logged-in desktop user visit by default, but may be configured to crawl as a mobile user as well. Additionally, for sites that employ user-group-based cache varies (i.e. retail customers vs. wholesale customers), or cookie-based varies (i.e. visitors with an affiliate cookie), the cache may be crawled simulating a logged-in user from any particular user group, or a user with a particular cookie. If you have the resources available, you could theoretically have dozens of crawlers going at once, simulating all sorts of user interactions.

Compression

Both plugins cache and serve compressed content. WPSC supports gzip compression, while LiteSpeed supports both gzip and brotli.

eCommerce

When you run an online shop, there are necessarily going to be pages (and sections of pages) that can’t be stored in the public cache. Shopping cart pages and last-viewed product widgets, are good examples of this.

Handling Private Content with WP Super Cache

WP Super Cache recommends using JavaScript for generating dynamic content, as JS doesn’t interfere with caching. This is a good idea and true for any cache plugin.

If JS is not an option, WPSC allows you to use a WordPress filter called wpsc_cachedata along with placeholder tags. The placeholders can be replaced with dynamically-generated HTML, and may be used for any content from a simple string to a shopping cart.

As this solution requires the use of a WordPress filter, it’s mostly aimed at developers who want to make their plugins compatible with WP Super Cache. Also, keep in mind that this dynamic content is not cached, which will slow down the serving of the page considerably.

Handling Private Content with LiteSpeed

LiteSpeed allows you to cache WooCommerce and other pages that contain mixed content. With ESI (Edge Side Includes), holes are punched on a public page, and are filled with shopping cart data and other private content. Then, the mixed-content page can be served to the shopper, fully cached.

This hole-punching behavior is built in to LSCache and is automated for WooCommerce, and some other popular plugins. Conveniently, ESI can be configured by site admins for use with any widget or shortcode. Developers may also choose to have their plugins support ESI natively through the LiteSpeed API.

Optimization

If you use site evaluation tools, like Google’s PageSpeed Insights, or GTmetrix, you’ll want a nice selection of optimization features in order to implement the tool’s suggested site improvements.

WPSC does not offer any optimization features aside from CDN support.

LSCache, however, includes CDN support, database optimization, minification and combination of JavaScript and CSS, HTTP/2 push, lazy load, and a variety of other popular optimization features, as shown in the table below. If you want to improve your PageSpeed score without installing additional plugins, LiteSpeed is the better choice.

Premium Services

WP Super Cache does not offer any extra premium services.

LiteSpeed Cache offers Image Optimization, Critical CSS Generation, and Lazy Load Responsive Placeholder Generation, all for free. These services are performed remotely on LiteSpeed’s own servers so as not to put any extra load on yours.

Cost

WP Super Cache is 100% free.

The LiteSpeed Cache plugin is also free, however a LiteSpeed web server is required in order to use the server-side cache, and there may be costs there, depending on your needs. There is a free, open source version (OpenLiteSpeed), or you can get an Enterprise license. License pricing ranges from Free for single site owners, to $96/month for large hosting companies, with several levels in between.

Feature Comparison

Let’s take a closer look at the specific features that come built into LSCache and WP Super Cache.

✅ = has the feature
💰 = has the feature, but it costs extra money in addition to any license costs
❌ = doesn't have the feature

We’ve listed these features using LiteSpeed Cache terminology. If the other plugin calls it something different, we put their term in parentheses.

Cache Features

FeatureLiteSpeed CacheWP Super Cache*
Full-Page Cache✅**
Tag-Based “Smart Purge”✅**
Tight Integration With Server✅**
Edge Side Includes (ESI)✅**
Crawler✅** (Preload/Rebuild)
WordPress Multi-Site Support✅**
Cache Logged-in Users✅** (WP-Cache caching)
Cache Separate Mobile View✅**
Cache Vary on User Group✅**
Cache Vary on Geographic Location, Currency, etc✅**
Cache REST API✅**
Purge Selected URLs on a Schedule✅**
Browser Cache Support✅**

* WP Super Cache feature list is based on what is listed publicly on its WP Plugin Directory page
**Feature requires a licensed copy of LiteSpeed Web Server with Cache Module

Optimization Features

FeatureLiteSpeed CacheWP Super Cache*
CDN Support
Database Optimization
CSS Minify
CSS Combine
CSS HTTP/2 Push
JavaScript Minify
JavaScript Combine
JavaScript HTTP/2 Push
Load CSS Asynchronously
Load JavaScript Deferred
HTML Minify
Exclude Selected URI’s from Optimization
Remove Query Strings
Remove Google Fonts
Lazy Load Images
Lazy Load iframes
Wildcard Usage in CDN Support

* WP Super Cache feature list is based on what is listed publicly on its WP Plugin Directory page

Premium Provided Services

ServiceLiteSpeed CacheWP Super Cache*
Critical CSS Generation
Image Optimization
Responsive Lazy Load Placeholder Generation

* WP Super Cache feature list is based on what is listed publicly on its WP Plugin Directory page

Costs

CostLiteSpeed CacheWP Super Cache*
Plugin CostFREE**FREE
Support CostFREEFREE

* WP Super Cache costs are based on what is listed publicly on its WP Plugin Directory page
**Requires a licensed copy of LiteSpeed Web Server with Cache Module for Cache Features

Conclusion

LiteSpeed Cache for WordPress and WP Super Cache both offer comprehensive full-page caching with a variety of features, but LiteSpeed’s server-side cache is more flexible, particularly when it comes to private cache and targeted cache management.

Plus, only LiteSpeed has a suite of popular site optimization functions, making it a great all-in-one acceleration solution for WordPress.

If you’d like to try LiteSpeed Cache, drop by our website to learn how to get started!


Categories:LSCache

Related Posts


Comments