Redis Object Cache on OpenLiteSpeed: Halve WooCommerce TTFB

Learn how Redis object cache on OpenLiteSpeed can cut WooCommerce Time-to-First-Byte by up to 50 %. Follow this step-by-step guide with real benchmarks.

Published by Rizwan on April 28, 2025
Edited by Rizwan on May 6, 2025

Your metrics don’t lie: a 900 ms Time-to-First-Byte on checkout pages is killing conversions. Every extra half-second sends would-be buyers straight back to Google and your ad budget down the drain.

OpenLiteSpeed already fires static assets fast, but WooCommerce’s dynamic queries still hammer MySQL. Flip on Redis object cache and those queries live in RAM, cutting TTFB by roughly 50 % in under ten minutes. This guide walks you through the switch step-by-step — and proves it with real-world benchmarks.

Why TTFB matters to revenue

  • Google’s Web Vitals flag anything above 200ms TTFB as poor.
  • A 100 ms delay can drop conversions by 7 %.
  • Cart, account and checkout screens are database-heavy and bypass normal page cache.

WooCommerce store owners feel the pain most because every uncached query hits MySQL and PHP.

How Redis object cache speeds WooCommerce

  1. Key-value store in RAM – Queries that WordPress would normally assemble from multiple tables are served from memory.
  2. Persistent between requests – Once populated, the result is instant for any visitor.
  3. LiteSpeed tight integration – LSCache talks to Redis through a UNIX socket, so there’s no TCP overhead.

Prerequisites

ComponentMinimum version
OpenLiteSpeed1.8+
PHP8.1+ with redis extension
LiteSpeed Cache (LSCache) plugin6.5+
WooCommerce (optional)8.6+

Your server should have at least 1 GB RAM free; Redis lives in memory.

Step-by-step setup (≈10 minutes)

1. Install Redis server

Ubuntu:

sudo apt update
sudo apt install redis-server -y
sudo systemctl enable --now redis-server

CentOS / AlmaLinux:

yum install redis -y
systemctl enable --now redis

Check it’s alive:

redis-cli ping   # PONG

2. Enable the PHP Redis extension

OpenLiteSpeed ships its own lsphp. Pick your active PHP version (example: lsphp82):

/usr/local/lsws/lsphp82/bin/pecl install redis
echo "extension=redis.so" > /usr/local/lsws/lsphp82/etc/php.d/redis.ini
systemctl restart lsws

3. Point LSCache to Redis

  1. WP-Admin → LiteSpeed Cache → Cache → Object Cache
  2. Set Object Cache to ON.
  3. Method: Redis
  4. Hostname: localhost
  5. Port: 6379 (skip if you use a UNIX socket like /var/run/redis/redis-server.sock)
  6. Click Save then Test Connection.

The dashboard will now show Object Cache: ON (Redis) like this:

4. Purge and warm the cache

  • Clear all LSCache entries.
  • Browse key pages (home, category, product, cart) while logged out to prefill Redis.
  • Optional: enable the built-in crawler to automate warming.

Benchmarks: before vs. after

PageBaseline TTFBWith RedisGain
Shop archive480 ms220 ms54 %
Single product530 ms260 ms51 %
Cart (2 items)680 ms330 ms51 %
Checkout (guest)720 ms350 ms51 %

Tests run on a 2 vCPU / 4 GB OpenLiteSpeed Droplet, WooCommerce dummy data, GTmetrix median of five runs.

Having memory issues? See my WPEngine memory limit guide

Troubleshooting

SymptomFix
“Redis extension: Disabled” in LSCachePHP extension path wrong; re-compile or correct redis.ini path.
Random “password reset link invalid”Increase Redis TTL to at least 600s so tokens stay valid.
Cache not fillingConfirm object cache drop-in isn’t overridden by another plugin.
High RAM useLower maxmemory in /etc/redis/redis.conf or move to a remote Redis node.

Advanced tweaks

  • UNIX socket – Add unixsocket /var/run/redis/redis.sock and point LSCache to it for +5 % speed.
  • Prefix per site – Multi-site? Set a unique WP_CACHE_KEY_SALT in wp-config.php.
  • Redis Cluster – Needed only when you exceed 2–3 GB cached objects.
  • Combine with QUIC.cloud – Use the CDN for HTML/full-page cache plus Redis for objects.

Conclusion

Switching on Redis object cache under OpenLiteSpeed is the fastest, cheapest way to slash WooCommerce TTFB. Ten minutes of work often doubles the speed of your cart and checkout, protecting revenue and delighting Google.

Need hands-on help tuning LiteSpeed, Redis or scaling WooCommerce? Let’s talk — hit the contact button and I’ll get back to you.

How we reviewed this article:

  • Content Process
My process of publishing articles include:
  1. I get an Idea
  2. Get feedback from fellow developers if they want a detailed post on it
  3. Research existing blog posts to see if there's a well written article on it
  4. Write the post
  5. Get feedback from colleagues, improve and publish!