Enable persistent object caching with Redis (or Memcached) through your host's dashboard first, or install a Redis connector plugin and click "Enable Object Cache" if you're self-managed. Either route needs a running cache server and a supported PHP client behind it. For most dynamic or high-traffic WordPress sites, this single change cuts repeated database queries dramatically, and it takes minutes once the server side is ready.
TL;DR:
- Enabling persistent object cache requires a working Redis or Memcached server, proper PHP client, and the correct
wp-content/object-cache.phpplacement.- Managed hosting providers often simplify the process with one-click Redis activation, removing manual server and configuration steps.
- Confirm object cache is active by checking plugin status, running WP-CLI commands, or monitoring cache hit and miss rates with tools like Query Monitor.
- Avoid cache-related issues by deleting the cache drop-in if problems occur, verifying Redis connectivity, and avoiding cache flushes during critical operations like checkout.
- Managed WordPress hosting plans, such as inSave Hosting, often include preconfigured Redis, PHP support, staging, and backups, minimizing setup and troubleshooting efforts.
Table of Contents
- What Does It Mean to Enable Object Cache?
- What Do You Need Before You Enable Object Cache?
- How Do You Enable Object Cache Through Your Host?
- How Do You Enable Object Cache With a Plugin?
- Which wp-config.php Constants Control Object Cache?
- How Do You Manage Object Cache From the Command Line?
- How Do You Verify Object Cache Is Actually Working?
- What Should You Do When Object Cache Breaks Something?
- Managed Redis or Self-Hosted: What Actually Makes Sense?
- Get Object Cache Running Without the Manual Setup
- Sources
- FAQ
What Does It Mean to Enable Object Cache?
WordPress already runs an object cache out of the box, but it's non-persistent: it only holds data for the length of a single page request, then discards everything. Enabling a persistent object cache with Redis or Memcached changes that. Cached objects, like database query results, user metadata, and plugin computations, stay in memory across requests instead of getting rebuilt every single time.
This matters most in specific situations:
- Logged-in dashboards and membership sites, where page caching doesn't apply
- Plugins that hit the database heavily, like WooCommerce or BuddyPress
- Multi-server or load-balanced setups where shared state speeds things up
Object cache is not the same thing as page cache. Page cache serves a finished HTML file; object cache speeds up the database and API calls that generate dynamic content in the first place. The two work best together, and tools that manage both layers tend to produce the biggest speed gains overall.
What Do You Need Before You Enable Object Cache?
Before touching any settings, confirm the infrastructure exists. Skipping this step is the number one reason "enabling" object cache fails silently.
- A running Redis or Memcached server, plus its connection details: host, port or socket path, password, and database number
- A supported PHP client installed on the server: PhpRedis, Predis, or Relay
- Write permission to add or edit
wp-content/object-cache.php, the drop-in file that actually activates the external cache - A rollback plan (a backup of the current
wp-contentfolder) in case the connection fails on a live site
Pro Tip: Ask your host directly whether PhpRedis is compiled into their PHP build before installing any plugin. Predis works as a pure-PHP fallback, but it's noticeably slower under load than the compiled PhpRedis extension.
How Do You Enable Object Cache Through Your Host?
Most managed hosts have already solved the hard part. Managed platforms commonly bundle Redis as a one-click feature, which removes nearly all the manual configuration a self-hosted setup requires.
- Log in to your hosting dashboard and locate the caching or Redis section, usually under performance settings.
- Toggle the Redis or object cache option on, then wait for the service to initialize (typically under a minute).
- Check whether the host auto-installs the drop-in file; many do this automatically once the toggle is flipped.
- If it doesn't happen automatically, contact support and ask for connection credentials, whether it's TCP or a Unix socket, the database number, and whether they assign a unique cache prefix per site.
Hosts that handle Redis service provisioning, the PHP extension, and drop-in placement in one step save you from most of the manual work described below.
How Do You Enable Object Cache With a Plugin?
If you're self-managing Redis or Memcached, a connector plugin is the fastest path. A persistent object cache needs three pieces working together: the server, the PHP client, and the drop-in file that bridges WordPress to both.
- Install and activate a well-maintained Redis connector plugin from the WordPress plugin repository.
- Add connection details to
wp-config.phpif your Redis server isn't on the default127.0.0.1:6379. Otherwise, the plugin's defaults usually work out of the box. - Open the plugin's settings page and click Enable Object Cache. This copies
object-cache.phpintowp-contentand opens the connection. - Confirm the status indicator shows "connected," not just "installed."
If you'd rather skip the plugin UI, you can copy or symlink object-cache.php into wp-content manually and configure the connection through wp-config.php constants or WP-CLI. WordPress's own wp_start_object_cache() function automatically detects and loads that drop-in on every request, so once it's in place and configured, no further activation step is needed.
Pro Tip: Test object cache enablement on a staging copy first if your host offers staging tools. A bad Redis connection string can produce a white screen faster than almost any other WordPress misconfiguration.
Which wp-config.php Constants Control Object Cache?
Configuration lives almost entirely in wp-config.php. Getting these constants right prevents most connection and cross-site problems before they start.
WP_REDIS_HOST— the Redis server address (e.g.,127.0.0.1or a socket path)WP_REDIS_PORT— typically6379unless your host uses a nonstandard portWP_REDIS_PASSWORD— required if your Redis instance enforces authenticationWP_REDIS_DATABASE— the numbered Redis database to isolate this site's keysWP_REDIS_TIMEOUTandWP_REDIS_READ_TIMEOUT— connection and read timeouts, usually 1 to 2 seconds
WP_CACHE_KEY_SALT deserves special attention. If multiple WordPress installs share one Redis instance without a unique salt, one site can read or overwrite another site's cached data. Set it to something identifiable, like the site's domain: define('WP_CACHE_KEY_SALT', 'example.com');
For distributed or multi-tier setups where Redis lives on a separate server from PHP, enabling WP_REDIS_USE_RELAY is worth considering. Relay keeps a partial replica of cached data in PHP memory itself, cutting network round trips and reducing lookup latency compared with standard clients.
How Do You Manage Object Cache From the Command Line?
For developers running deployments through automation, WP-CLI is faster and more reliable than clicking through plugin screens. Redis connector plugins expose dedicated commands for exactly this purpose:
wp redis enable— installs the drop-in and activates the connectionwp redis status— reports connection health, hit ratio, and configurationwp redis disable— removes the drop-in and reverts to WordPress's default cachewp redis update-dropin— refreshes the drop-in file after a plugin update
The drop-in itself is either copied or symlinked into wp-content. In CI/CD pipelines, that file needs explicit protection: either version it directly or recreate it as a deployment step, because an automated build that wipes wp-content clean will silently disable object caching without throwing an error.
How Do You Verify Object Cache Is Actually Working?
Enabling the drop-in isn't the finish line. Confirm it's connected and actually reducing database load before you call the job done.
- Check the plugin's status page for hit and miss counts, or run
wp redis statusfor a command-line summary. - Install Query Monitor and look at its object cache panel, which breaks down cache performance per request.
- Expect a low hit rate immediately after enabling. Cache "warms up" as pages get requested repeatedly; steady-state performance usually takes a few hours of normal traffic to appear.
- Clear stale transients when migrating from database-stored transients to Redis, especially on WooCommerce stores with heavy session activity, since old data can otherwise linger and cause inconsistent behavior.
What Should You Do When Object Cache Breaks Something?
Object cache failures tend to be dramatic (white screens, timeouts) but the fixes are usually fast if you work through them in order.
- Rename or delete
wp-content/object-cache.phpimmediately. This forces WordPress back to its built-in non-persistent cache and restores the site while you diagnose the real issue. - Check that the Redis or Memcached service is actually running, and confirm credentials are correct. Restart the service or escalate to your host if it's unreachable.
- If two sites are behaving strangely at the same time, suspect a
WP_CACHE_KEY_SALTcollision on a shared Redis instance and assign unique salts or separate database numbers immediately. - Flush Redis only when necessary, and never on a live e-commerce site during business hours. Planning for this transition matters: a flush wipes session and cart data cached in Redis, which can log users out or empty carts mid-checkout.
- Use non-persistent cache groups to exclude chatty plugins that write constantly but rarely benefit from persistence, reducing unnecessary load on Redis.
Pro Tip: Keep a text file with your exact rollback command (the rename command for the drop-in) taped to your mental dashboard. When a site is down, you don't want to be searching Stack Overflow for the syntax.
Managed Redis or Self-Hosted: What Actually Makes Sense?
Most site owners don't need to run their own Redis instance, and pretending otherwise creates unnecessary risk. Managed hosting makes sense the moment you'd rather not be the person debugging a stalled Redis service at 2 a.m. Self-hosting earns its keep only when you need a custom Redis cluster topology or you're already running dedicated infrastructure for other reasons.
The pitfall I see most often isn't bad configuration. It's sites that never verify the connection actually took, and run for months thinking they're cached when the drop-in silently failed. inSave Hosting's managed WordPress plans handle the server side, the PHP client, and drop-in placement automatically, which removes that entire failure mode for most customers.
— Ihor
Get Object Cache Running Without the Manual Setup
Reading through the constants, WP-CLI commands, and rollback steps above tells you something: enabling object cache correctly involves a real amount of server-side coordination, not just a plugin toggle.

inSave Hosting's WordPress hosting plans come with Redis and LSCache preconfigured, PHP8 support, staging environments, and free migration, so the server, PHP client, and drop-in placement are already handled before you log in. That means skipping the credential hunting and connection debugging covered in the troubleshooting steps above entirely. Free daily backups also cover the rollback scenario directly, so a bad connection never turns into a real outage. If you're currently on a host without managed Redis, migration support is included. Check the WordPress hosting plans and get object cache running on your next deploy instead of your next support ticket.
Sources
- WP_Object_Cache | WordPress Developer Resources
- What Is Object Cache and How to Enable It on WordPress: The Complete Expert Guide
FAQ
What Is the Difference Between Object Cache and Page Cache?
Object cache speeds up database and API queries behind the scenes, while page cache serves a complete, pre-built HTML page. Dynamic sites, like WooCommerce stores or membership platforms, benefit most from running both together.
Do I Need Redis or Memcached to Enable Object Cache?
Yes. WordPress's built-in object cache only persists for a single page load; you need Redis or Memcached running as a server to get caching that survives across requests.
How Do I Know if Object Cache Is Actually Enabled?
Run wp redis status from WP-CLI, or check your connector plugin's settings page for a "connected" status along with live hit and miss counts.
Can Enabling Object Cache Break My Site?
It can, usually through a bad connection string or a Redis service that isn't running. Renaming or deleting wp-content/object-cache.php immediately reverts WordPress to its default non-persistent cache and restores access.
Does inSave Hosting Support Object Caching Out of the Box?
Yes. inSave Hosting's WordPress hosting plans include managed Redis and LSCache with the server, PHP client, and drop-in already configured, so enabling object cache doesn't require manual setup.
