WordPress performance is critical, especially for WooCommerce stores with high traffic. One of the best ways to speed up your site is object caching using Redis. In this tutorial, we’ll show you how to enable Redis for LiteSpeed Cache on AlmaLinux 8 with PHP 8.2.
Step 1: Verify Redis is Running
First, make sure Redis is installed and running on your server:
systemctl status redis
You should see:
Active: active (running)
Test connectivity using the Redis CLI:
redis-cli -h 127.0.0.1 -p 6379 ping
Expected output:
PONG
✅ This confirms Redis is running locally.
Step 2: Check PHP Redis Extension
LiteSpeed Cache requires the PHP Redis extension. Check if it’s installed:
php -m | grep redis
- If nothing shows up, install Redis for your PHP version. For PHP 8.2 with Remi repository, use:
dnf install php82-php-redis -y
- Restart LSWS to load the extension:
systemctl restart lsws
Step 3: Configure LiteSpeed Cache
- Go to your WordPress admin → LiteSpeed Cache → Object
- Toggle Object Cache → ON
- Select Redis as the caching method
- Set the host to
127.0.0.1and port6379 - Click Test Connection
If Redis is correctly installed and running, you should see Connection Successful.
Step 4: Restart PHP Processes (If Needed)
Sometimes LiteSpeed Cache doesn’t detect Redis immediately. You can restart detached PHP processes from cPanel → PHP Processes → Restart Detached.
- After this, revisit the Object Cache settings and test the connection again.
- Redis should now be enabled and ready to accelerate your WordPress site.
Step 5: Enjoy Faster WooCommerce Performance
- Redis stores frequently accessed objects in memory, reducing database queries.
- WooCommerce pages load faster, checkout is smoother, and server load decreases.
💡 Tip: For best performance, combine Redis with LiteSpeed full-page caching and a CDN for global visitors.
Conclusion
By following these steps, you can enable Redis object caching on AlmaLinux 8 with PHP 8.2 and LiteSpeed Cache. This simple optimization significantly improves WordPress and WooCommerce performance, making your site faster and more scalable.