Your Cart
LiteSpeed Cache object cache

LiteSpeed Cache Object Cache: When to Use Redis or Memcached in WordPress

LiteSpeed Cache can connect WordPress to an external object-cache service, but the plugin does not provide the cache server itself. Redis, Memcached and LSMCD are separate services that must be available in the hosting environment. This distinction matters when a site owner enables object caching and expects the plugin alone to create a working backend.

The practical question is not whether every WordPress site should use object caching. It is whether important requests execute PHP and repeatedly retrieve data from the database. A fully page-cached request may be served without invoking PHP, so it may use object caching less often. Redis and Memcached should therefore be compared according to the site workload, hosting support and operational requirements—not according to an assumed universal performance ranking.

What LiteSpeed Cache object caching does—and does not do

Object caching stores results of expensive or frequently repeated database queries so WordPress can reuse them instead of querying the database repeatedly. This can be relevant for dynamic requests, uncached pages and pages that are regenerated frequently. It is a layer that helps WordPress retrieve data during PHP execution; it is not the same mechanism as serving a complete page from a full-page cache.

LiteSpeed Cache provides integration with external backends such as Redis, Memcached and LSMCD. Installing or activating the WordPress plugin does not install, start or administer one of these services. The selected service, its PHP extension and its connection details must work on the server before WordPress can use object caching.

Full-page cache versus object cache

Full-page caching and object caching operate at different points in the request. When LiteSpeed Cache serves a fully cached page, PHP may not be invoked for that request. In that situation, WordPress does not need to retrieve the page’s database data while building the response, so object caching may be used less often.

Object caching becomes more relevant when WordPress must build the response through PHP and repeatedly request expensive or frequently used database results. It should be considered a response to a specific workload, not an automatic requirement created by installing LiteSpeed Cache. It also does not replace WordPress database backups: cached data may be evicted or lost depending on the service configuration.

When object caching is worth considering

Start with the requests that matter to the site rather than with a general performance assumption. If important pages are fully page-cached, object caching may have a smaller role for those requests. If pages are dynamic, uncached or frequently regenerated, WordPress may repeatedly execute PHP and retrieve database data, making an object-cache backend more relevant.

WooCommerce, memberships and logged-in-user scenarios deserve careful testing because their functionality is dynamic. That does not prove that object caching is required, nor does the available research establish a universal traffic or query-count threshold. The decision should follow the actual workload and observable cache activity.

A workload-based decision checklist

  • Identify whether the important requests are fully page-cached or built through PHP.
  • Consider whether repeated or expensive database queries are part of the observed workload.
  • Check which object-cache service and PHP extension the hosting environment supports.
  • Use the LiteSpeed connection test and debug information after configuration instead of assuming that enabling a setting produced a benefit.
  • Test changes on staging or during a controlled maintenance window when dynamic functionality is important.

Redis vs Memcached for WordPress

Neither Redis nor Memcached is universally correct for WordPress. Memcached is a simpler in-memory key-value cache intended to reduce database load for dynamic web applications. It uses expiration and least-recently-used eviction behavior. Its straightforward model may be adequate when the site needs basic object caching and the hosting provider supports it.

Redis offers richer data structures and can provide capabilities such as optional persistence, replication and clustering. Those are architectural distinctions, not proof that Redis will always make a WordPress or WooCommerce site faster. The available research contains no controlled benchmark establishing a universal performance winner for these workloads.

A practical comparison should therefore include the host’s available services, the PHP extension, the administrator’s ability to maintain the backend, connection isolation and the site’s operational requirements. A supported and correctly maintained simpler backend may be more appropriate than a more feature-rich service that the environment cannot administer reliably.

When a simpler Memcached deployment may be adequate

Memcached is designed for basic in-memory key-value caching. It can reduce repeated database work for dynamic applications, while expiration and eviction determine how cached entries are retained. Its servers are disconnected from one another, distribution and server selection are handled by clients, and it does not provide built-in replication between servers.

These characteristics can fit a conventional WordPress object-cache use case when Memcached is available through the hosting environment and no additional Redis capabilities are needed. This is an environment-dependent choice, not a promise of a particular speed improvement.

When Redis capabilities may matter

Redis may be considered when the deployment’s operational or application requirements match its documented capabilities, including richer data structures, optional persistence, replication or clustering. These capabilities are not necessary for ordinary WordPress object caching by definition, and persistence should not be treated as automatically required.

Redis and Memcached should also be treated as cache layers, not as replacements for database backups. Do not expose either service publicly without appropriate access controls, firewall rules and hosting-provider guidance.

Server requirements before enabling object cache

Before changing LiteSpeed Cache settings, confirm that the server side is ready. WordPress object caching requires a functioning Redis, Memcached or LSMCD service and the corresponding PHP extension, such as php-redis or php-memcached. The extension must be available to the PHP version that serves the WordPress site.

The connection details must also match the actual deployment. Depending on the environment, WordPress may connect through a hostname and port or through a UNIX-socket path. Site owners without server-level access may need their hosting provider or administrator to enable the service and extension. Installation commands and exact values vary by provider, operating system, control panel and PHP version.

TCP and UNIX-socket connection details

A host-and-port configuration requires the service to be active and reachable at the configured endpoint. A UNIX-socket configuration requires the socket path to be correct and the ownership and permissions to align with the user running PHP.

Do not weaken filesystem or socket permissions merely to make a connection test pass. Do not broadly change firewall settings without administrative guidance. When the connection method or permissions are outside your control, ask the hosting provider to verify the service, extension and endpoint.

LiteSpeed Cache configuration and verification workflow

After the backend and PHP extension are ready, use the object-cache settings under LiteSpeed Cache > Cache > Object. LiteSpeed Cache automatically tests the connection after object caching is enabled and detects the relevant Memcached or Redis extension. The test is useful because an enabled setting alone does not prove that WordPress can communicate with the service.

On a shared server, use a unique object-cache prefix where appropriate. LiteSpeed documents prefixes as a way to help prevent key collisions or cross-site key access. This is an isolation consideration, not a substitute for correct service configuration or access controls.

Connection test and debug evidence

Run the built-in connection test after the service and extension are available. If debug logging is enabled, LiteSpeed’s debug output can show object-cache totals, hits, misses and set operations in the page source. These counters provide evidence that the cache is being used, rather than merely enabled.

Interpret the result carefully. A successful connection confirms communication with the backend, while hit and miss activity shows how requests interact with it. Neither result is a universal guarantee of improved performance. Observe the actual workload, especially before applying changes to WooCommerce, memberships or logged-in-user functionality in production.

Troubleshooting failed connections and unexpected behavior

A failed connection test should be diagnosed in layers. First verify that the selected Redis or Memcached service is active and that the expected port or socket is available. Next check that the PHP extension loaded by the PHP version serving WordPress matches the selected backend. Finally compare the LiteSpeed settings with the service’s actual host, port, socket path, credentials and database configuration.

For Memcached, LiteSpeed recommends checking whether the service is active, whether its port is listening and whether a local connection succeeds. For Redis, a suitable ping test should return PONG. Use environment-appropriate tools and values; service names, ports, socket paths and privileges vary by server, so commands should not be copied blindly.

A layered troubleshooting sequence

  1. Start with the service: confirm that Redis or Memcached is running and that the expected endpoint is listening.
  2. Check PHP: verify that the corresponding extension is loaded by the PHP version used by WordPress.
  3. Check connection details: compare host, port, socket path, credentials and database settings with the actual service configuration.
  4. Check permissions: for UNIX sockets, confirm ownership, permissions and the PHP-running user without weakening access controls.
  5. Check LiteSpeed: run the connection test, enable appropriate debug logging and inspect hits, misses and set operations.

Change one layer at a time and retest. Avoid disabling authentication or making broad firewall changes to force connectivity. If the service or permissions are controlled by the host, involve the provider or administrator. Controlled cache clearing or rebuilding can be part of a planned test, but it should not replace diagnosing the underlying connection.

A practical Redis-or-Memcached decision framework

The choice should follow the hosting environment, workload and maintenance responsibility. First establish whether object caching is relevant to PHP-generated requests. Then select a backend that the host supports and that the administrator can operate correctly. Finally verify both the connection and actual cache activity on the site’s representative workload.

Decision summary

Choose Memcached when a simple in-memory key-value cache meets the site’s needs and is supported by the hosting environment. Consider Redis when its richer data structures, optional persistence, replication or clustering match the deployment’s requirements. Neither option is a universal performance winner, and neither replaces database backups.

LiteSpeed Cache object caching is an integration with an external service, not a cache server supplied by the plugin. Start with the workload, confirm the server requirements, test carefully and troubleshoot without weakening security controls. Explore our WordPress plugins, WooCommerce extensions, themes and membership plans to find the right tools for your website.

One comment

Comments are closed.

Free Worldwide shipping

You can download the products right away at wpbetterplugins.com

Immediate delivery

After the payment is credited, the product is ready for download

International Warranty

Offered in the country of usage

100% Secure Checkout

Stripe / Apple Pay / Google Pay / MasterCard / Visa

Zadzwoń