Enabling Redis Object Cache in LiteSpeed Cache for WordPress

What Object Cache is

Object Cache stores the results of frequent database queries, so that the database does not need to be accessed every time a page loads. For example, every time a visitor loads a WordPress page, the system needs to read the site settings, menus, widgets and many other items from the database. With Object Cache enabled, this data is stored in memory (RAM) and retrieved much faster.

Redis is an in-memory database used as a cache layer between the application (WordPress) and the database (MySQL/MariaDB). On Konet servers, each cPanel account has its own separate Redis instance, ensuring full isolation between accounts.

Requirements for Redis Object Cache in LSCache

For Redis Object Cache to work, you need the following:

You do not need to do anything at server level. Konet has already configured and enabled a separate Redis instance for each account. The only configuration needed is done from the WordPress dashboard.

Configuring Redis Cache step by step

Step 1: Access the Object Cache settings

Log in to the WordPress dashboard (wp-admin) and navigate to: LiteSpeed Cache > Cache > Object. It is tab [6] in the Cache settings.

Step 2: Connection settings

Fill in the fields as follows:

  • Object Cache: ON
  • Method: Redis
  • Host: /tmp/redis.sock
  • Port: 0
  • Default Object Lifetime (TTL): 360 (seconds)
  • Username: leave it empty
  • Password: leave it empty
  • Redis Database ID: 0

Important note about the Database ID: If you have more than one WordPress installation in the same cPanel account (e.g. a main site and a subdomain or subdirectory), each installation must use a different Database ID (0, 1, 2 and so on) to avoid a conflict (cache collision) between them.

Step 3: Operation settings

In the remaining fields on the same page:

  • Global Groups: Leave the default values as they are. These are standard WordPress data groups that must be shared in multisite installations.
  • Do Not Cache Groups: Leave the default values. If you use WooCommerce, make sure the value wc_session_id is included.
  • Persistent Connection: ON. This keeps the connection to Redis open and avoids the connect/disconnect overhead on every request.
  • Cache Wp-Admin: ON or OFF depending on your needs. If you notice that changes in the admin do not appear immediately, turn this option off.

Step 4: Save and confirm

Click Save Changes. After saving, check the Status field at the top of the page. You should see:

  • Redis Extension: Enabled
  • Connection Test: Passed

If the connection test fails, check that you typed the path /tmp/redis.sock correctly in the Host field and that the Port is 0.

Why we use a Unix Socket instead of TCP

On Konet servers, each cPanel account has its own independent Redis instance that communicates through a Unix socket (a file on the filesystem) instead of a TCP port. This is done for two reasons:

First, performance. Communication through a Unix socket is faster than TCP, as it bypasses the operating system's network stack.

Second, security and isolation. Each account has access only to its own Redis socket. There is no shared TCP port, so no account can access another account's cache data.

Important note: The settings above apply only to Konet servers and not to other servers. This is because, on the one hand, we use LiteSpeed Enterprise Web Server (not OpenLiteSpeed) and, on the other hand, we have specific custom settings in the integration of cPanel, CloudLinux and LiteSpeed Enterprise Web Server in order to achieve the best possible performance.

Summary table of Redis settings in LSCache

Setting Value
Object Cache ON
Method Redis
Host /tmp/redis.sock
Port 0
TTL 360
Username Empty
Password Empty
Database ID 0 (or 1, 2, 3... if you have multiple WP installations)
Persistent Connection ON

Frequently asked questions about Redis in LSCache

Q: The connection test fails. What do I do?

Make sure that in the Host field you enter exactly /tmp/redis.sock (with no spaces before or after) and that the Port is 0. If the problem persists, contact us via a ticket.

Q: Do I need to install anything in cPanel?

No. Konet automatically configures and enables the Redis service on every account. The only configuration on your side is done in the LiteSpeed Cache plugin within WordPress.

Q: Should I use another plugin for Redis?

No. LiteSpeed Cache for WordPress includes built-in support for Redis Object Cache. You do not need to install additional plugins (e.g. Redis Object Cache, W3 Total Cache, etc.). Using several caching plugins at the same time can cause problems.

Q: Which Database ID do I use if I have two WordPress sites in the same account?

Use Database ID 0 for the first WordPress site and Database ID 1 for the second. You can use values from 0 to 15.

Q: Will I see a speed difference immediately?

The improvement is most noticeable on websites with many database queries, such as WooCommerce e-shops, sites with many plugins, or sites with a lot of dynamic content. On a simple blog the difference may not be as visible, but Object Cache reduces the database load in every case.

Q: How do I clear the Object Cache?

From WordPress: LiteSpeed Cache > Toolbox > Purge > Purge All. This will clear both the page cache and the object cache.

If you need help with the configuration or are facing a problem, do not hesitate to open a ticket in your Client Area at billing.konet.gr.

Was this article helpful?

Related service Konet Web Hosting cPanel, LiteSpeed and automatic backups on every plan.

Related articles