WpW: Private Cache vs. Public Cache
Welcome to another installment of WordPress Wednesday!
We’ve recently released an update to our plugin, and now we support private cache! Today we’re going to talk about the difference between public and private cache, and what this means for your WordPress blog.
Public vs. Private
Public cache is cache that can be accessed by everyone. A single copy of a publicly-cached page is stored and served to everyone who requests it.
Private cache is only accessible to an individual visitor. It usually contains information that is only pertinent to that particular user (for instance, the wordpress admin bar). When a page is privately-cached, there is a separate copy stored for each user that requests it.
Until this most recent update, LiteSpeed Cache for WordPress only dealt in public cache, and so any page that has individualized data on it, would just not be cached at all. When a user is logged in, there is the potential for every page to have private data on it, and so pages were never cached for logged-in users.
As of v 1.1.6, LSCWP supports private cache. This means many of the pages that were once considered uncacheable may now be cached privately instead.
Is this the same thing as ESI?
No. This is an essential stepping-stone to ESI, though. ESI (Edge Side Includes) technology allows you to disassemble a page, pull some parts of it from public cache, and other parts of it from private cache, re-assemble the page, and serve it to the visitor.
Currently, we still are dealing in full pages only. A page can be publicly-cacheable, privately-cacheable, or not cacheable at all.
Our ESI implementation is currently in the testing stage, so while it is coming for LiteSpeed Enterprise customers, this is not it.
OpenLiteSpeed doesn’t support ESI, but we want OLS users to have good options, too. Private cache functionality is one of those good options.
[UPDATE: ESI is available now.]
So, how does our private cache work?
There are two situations in which you now have the ability to enable private cache: when a user is logged in, or when a visitor has pending comments. You can enable or disable private cache functionality in WP-Admin. Navigate to LiteSpeed Cache > Settings > Cache and press the appropriate button as shown below.
When Cache Logged in User is set to
Enable, LSCWP will privately cache every page for logged-in users. Each logged-in user will have their own individual copy of every cacheable page they visit.
When set to
Disable, no pages will be cached at all for logged-in users.
When Cache Commenter is set to
Enable, LSCWP will cache pages for users who have left a pending comment. This setting is relevant for sites where comment moderation is enabled. Visitors who have left a comment that is awaiting moderation are able to see their comment, even though nobody else is able to do so. This makes their view different than everyone else and therefore ineligible to be served from public cache. Previously, we just would not cache any pages for them, but now we can cache the pages privately instead.
When set to
Disable no pages will be cached at all for visitors who have left a pending comment.
We’ve got more enhancements to come! In the meantime, we hope you’ll share your feedback and let us know how we’re doing! And of course, if you find any of this confusing, don’t hesitate to reach out and ask us about it. That’s what we’re here for.
Also! If you are a fan of our plugin, would you mind leaving us a rating or review in the WP Plugin directory if you haven’t already? Every little bit of word-of-mouth helps! Thanks 🙂
Have some of your own ideas for future WordPress Wednesday topics? Leave us a comment!
Don’t forget to meet us back here next week for the next installment. In the meantime, here are a few other things you can do:
- Subscribe to the WordPress Wednesday RSS feed
- Download LiteSpeed Cache for WordPress plugin
- Learn more about the plugin on our website