A Redis object cache keeps the results of WordPress database queries in RAM, so the cart, customer account and admin — pages the page cache does not cover — load faster. It works only when WordPress has an active object-cache.php file connected to a running Redis instance; a green plugin status does not guarantee that, which is why you check the number of keys and hits.
Page cache vs object cache
| Page cache | Object cache (Redis) | |
|---|---|---|
| What it stores | Finished HTML of a whole page | Database query results and plugin calculations |
| When it helps | Products, categories, posts for logged-out visitors | Cart, checkout, account, admin, search |
| Does it start PHP? | No | Yes, but with fewer database queries |
The two kinds of cache complement each other. A page cache alone will not speed up checkout, and an object cache alone will not take the load off the server when traffic hits product pages.
How to turn on Redis in WordPress
A Redis instance
Your host has to provide Redis for your account (an address or socket, and possibly a password).
A plugin
The Object Cache settings in the LiteSpeed Cache plugin, or the Redis Object Cache plugin. The plugin installs the
wp-content/object-cache.phpfile.Verification
Check the status in the plugin settings or with the WP-CLI command
wp redis status(with the Redis Object Cache plugin).
How to check the cache really works
- The number of keys grows after you browse a few store pages. An empty or unchanging Redis database means WordPress is not using it.
- Hits outnumber misses after a few minutes of traffic.
- Query Monitor shows fewer database queries on the cart page than before.
- After moving the store, check the Redis address and port in the configuration — a copy of the site carries settings pointing at the old server, and the site keeps working, only more slowly.
An object cache will not fix slow queries that are different every time (such as filtering by many attributes), nor plugins waiting on an external API.
Redis on Aderlo Cloud
Every Aderlo Cloud account gets its own Redis instance, not shared with other customers, and Aderlo Cloud sets up the cache layer (LSCache and object cache) itself — including on sites moved from another provider, within a quarter of an hour of the site appearing. After migrations the cache is checked by the number of keys, not just the HTTP status code.
WordPress hosting on Aderlo Cloud →Frequently asked questions
- Does a small store need Redis?
- With a few orders a day the difference can be small. It grows with the number of logged-in customers, products and plugins, because that is when the cart and account run the most database queries.
- Can Redis and LiteSpeed Cache work together?
- Yes. LiteSpeed Cache handles the page cache and can connect to Redis in its Object Cache settings; this is the standard setup on LiteSpeed servers.