Web Hosting Knowledge Base / Hosting and Websites

What is Redis Object Caching and How to use it for WordPress?

Understanding Object Caching

When someone visits your website, WordPress pulls information from the database to display the content. This process takes time, especially for busy or complex sites. Object caching helps by temporarily storing (or "caching") that information so that WordPress doesn’t have to fetch it from the database every time. This makes your website load faster the subsequent page loads and reduces the strain on your server.

Object caching is different from page caching. Page caching saves entire pages so they load quickly for visitors, while object caching focuses on storing database-related data to speed up dynamic content.

Do You Need Object Caching?

  • You’ll benefit from it if: You have a busy WordPress site, a WooCommerce store, or a website with lots of user interactions, such as searches, filters, or frequent updates.
  • You may not need it if: You run a small blog or a mostly static website (Just landing pages made with Elementor for example) with minimal database activity.
  • What to expect: Faster page loads, better server performance, and a smoother experience for visitors.

Availability

2MHost offers Redis Object Caching for free for Performance Hosting and Business Hosting packages on LiteSpeed-based servers.

How to Enable Redis in cPanel:

  1. Log in to cPanel.
  2. Go to the Advanced tab.
  3. Click LiteSpeed Redis Cache Manager.

  4. Click Enable Redis Service.

Settings for Caching Plugins

Use these settings in any Caching plugin that supports Object Caching:

  • Method: Redis
  • Type: Unix socket
  • Redis Host: /tmp/redis.sock
  • Port: 0

Enabling Redis with LiteSpeed Cache (LSCache) for WordPress

  1. If using a non-native PHP version, ensure the Redis extension is enabled in cPanel.
  2. Log in to WordPress.
  3. Navigate to LiteSpeed Cache Plugin > Cache > Object.
  4. Set Object Cache to ON.
  5. Configure settings:

    • Method: Redis
    • Host: /tmp/redis.sock
    • Port: 0
  6. Click Save Changes.
  7. In Object Cache Status, ensure the Connection Test shows 'Passed'.
Last update: Mar 11, 2025 01:10