Articles on: ​Web Hosting

Configuring Redis Object Caching using Litespeed Cache

What is object caching?



An object cache stores the results of expensive and/or frequent database queries in a way that makes them easy to retrieve, and eliminates the need for repeated access to the database. Object caching greatly reduces the time it takes to retrieve query results.

What is Redis?



Redis (Remote Dictionary Server) is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker.

It supports data structures such as strings, hashes, lists, sets, range queries, bitmaps, hyper loglogs and geospatial indexes with radius queries.

In its simplest form, Redis is a caching system that can be combined with MySQL or MariaDB to optimize the application level speed.

How do I enable Redis?



We have a separate guide that covers enabling Redis on your Premium PCI-DSS compliant hosting account (Link opens in a new tab).

How do I enable Object Caching in LiteSpeed Cache?



In order to follow this guide, you will need to be able to access your cPanel account (Link opens in a new tab).

Login to your cPanel account
Navigate to the Advanced section and click Redis Manager



Copy your Socket path as shown i.e. /var/kredis/enableredis/redis.sock



Log In to your WordPress dashboard
Navigate to LiteSpeed Cache and click on Cache



Navigate to the Object menu



Under the Object Cache Settings, change Object Cache from OFF to ON.



Change the Method from Memcached to Redis



In the Host box, paste the socket path you copied earlier.
As Redis runs on a UNIX socket, set the port to 0



Click the Save Changes option at the bottom of the form



Done!

*

*

Updated on: 24/01/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!