Rizwan Rizwan
HOME SERVICES CASE STUDIES BLOG ABOUT $100 USD FREE Consultation Call →
DEVOPS
WORDPRESS

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.

Rizwan Rizwan May 27, 2025 5 min read
Redis Object Cache on OpenLiteSpeed: Halve WooCommerce TTFB

Table of Contents

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

Component Minimum version
OpenLiteSpeed 1.8+
PHP 8.1+ with redis extension
LiteSpeed Cache (LSCache) plugin 6.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. Go to WP-Admin → LiteSpeed Cache → Cache → Object Cache
  2. Set Object Cache to ON.
  3. Set Method to Redis
  4. Set Hostname to localhost
  5. Set Port to 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

Page Baseline TTFB With Redis Gain
Shop archive 480 ms 220 ms 54 %
Single product 530 ms 260 ms 51 %
Cart (2 items) 680 ms 330 ms 51 %
Checkout (guest) 720 ms 350 ms 51 %

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

Symptom Fix
"Redis extension: Disabled" in LSCache PHP 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 filling Confirm object cache drop-in isn't overridden by another plugin.
High RAM use Lower 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? Get in touch with me

Rizwan

About Rizwan

Full-stack developer and technical leader with 13+ years building scalable web applications. I help agencies and startups ship faster through strategic guidance and hands-on development.

MORE INSIGHTS

Keep reading for more development wisdom.

DevOps

Ultimate LEMP Stack Installation Guide for Ubuntu

In this article, you'll install PHP 8.3, NGINX, MySQL, PHPMyAdmin, SSL, Composer and NPM on a fresh Ubuntu installation.

Rizwan Rizwan July 19, 2025 5 min read
DevOps

How to Set Up a Secure Deploy User for GitHub Actions (And Why You Should Never Use Root)

Avoid root in Laravel CI/CD. Here’s how to create a secure "deploy" user for GitHub Actions, with exact commands and a full checklist.

Rizwan Rizwan July 13, 2025 5 min read
DevOps

How to Automatically Restart MySQL Database on Low Memory DigitalOcean Droplets

Safeguard your WordPress site on a low-memory DigitalOcean droplet by setting up an automatic MySQL monitoring and restart service to minimize downtime and keep your site running smoothly.

Rizwan Rizwan May 27, 2025 5 min read

HOW I CAN HELP YOU

I work with founders, agencies, and developers who need that extra push to get projects live. Whether it's fixing a stubborn bug, steering your tech strategy, or building full apps with my team. You don't have to do it alone

GET UNSTUCK

60-minute call to debug your specific problem. Stop spinning your wheels.

$249
BOOK NOW →

FRACTIONAL CTO

Ongoing strategic guidance to prevent disasters like this.

$2k-7k/mo
LEARN MORE →

CUSTOM DEV

Full project rebuild with our expert team. Done right the first time.

Custom
GET QUOTE →