Skip to main content
KadiCache
Core & Object CacheFree Core

7-Driver Persistent Object Cache

Eliminates repetitive MySQL queries across dynamic admin, logged-in, and checkout flows with 7 native drivers, L1 in-request memory, 200-key route Batch Prefetch, igbinary/zstd/zlib compression, and a 5-second circuit-breaker.

Object Cache Hit Ratio
98.4%
Verified Source Entry
apps/wordpress-plugin/src/Cache/ObjectCache/ObjectCacheEngine.php
Verified Engine Capabilities

Engineered for zero regressions.

  • 7 native drivers: APCu, Relay, PhpRedis, PhpStreamRedis (no C-ext needed), Memcached, SQLite WAL, Sharded File
  • Route-level Batch Prefetch loads up to 200 hot keys in a single round-trip
  • Built-in AutoloadAnalyzer inspects oversized wp_options autoload payloads
  • 5-second automatic circuit-breaker keeps WordPress online if Redis restarts
WP-CLI Persistent Object Cache Probe & Status
$ wp kadicache object-cache status --format=json
$ wp kadicache object-cache info --format=json
# Probes live backend latency, active serializer/compressor,
# 200-key route prefetch state, split_alloptions, and top autoloaded wp_options
Inside the KadiCache WordPress Plugin

7-Driver Persistent Object Cache — Plugin Interface

2 live 2x Retina plugin screens
WP Admin -> KadiCache -> Object Cache
MODULE 02 · 2X RETINA
Persistent Object Cache engine with Smart Route Prefetching, race-free split_alloptions, and 5-second circuit breaker.2880×1840 WebP
100% Source-Code Verified9 min engineering readUpdated 2026-11-23
Executive Summary · 30-Second SpecZero-Regressions Spec
WP Admin Path
WP Admin -> KadiCache -> Object Cache
Measured Impact
98.4% Hit Ratio · 1-RTT 200-Key Route Prefetch
Verification Marker
wp kadicache object-cache status | wp-content/object-cache.php
  • Ships 7 native storage backends (RelayDriver, PhpRedisDriver, PhpStreamRedisDriver, MemcachedDriver, ApcuDriver, SqliteDriver, FileObjectDriver) with automatic capability detection.
  • Learns up to 200 hot keys per route (MAX_PREFETCH_KEYS = 200) and warms L1 request memory in a single MGET round-trip before plugins execute.
  • Eliminates the infamous WordPress #31245 alloptions race condition via split_alloptions individual hash fields and hybrid APCu L1 verification.
  • Fails open in 5 seconds (CIRCUIT_COOLDOWN_SECONDS = 5) if Redis or Memcached restarts, keeping wp-admin and WooCommerce checkout online.
Table of Contents (5 sections)

Where Page Caching Stops, Persistent Object Caching Takes Over#

Full-page HTML caching makes anonymous storefront browsing instantaneous, yet 30% to 45% of real WordPress CPU time happens on requests that intentionally bypass full-page cache: wp-admin product editing, WooCommerce cart and checkout submissions, REST API calls, admin-ajax.php endpoints, logged-in membership dashboards, Action Scheduler background ticks, and uncached page rebuilds.

Without a persistent wp-content/object-cache.php drop-in, WordPress's default WP_Object_Cache discards every cached option, term relationship, post meta lookup, and transient the millisecond the PHP request finishes. Even with a basic third-party Redis drop-in installed, two architectural bottlenecks routinely degrade busy WooCommerce stores:

  1. The "Death by 400 Sequential GET Calls" Problem: A single WooCommerce checkout or wp-admin/edit.php?post_type=product load often triggers 350 to 700 individual wp_cache_get() calls. Even when Redis responds in 0.25 ms per TCP call, 500 sequential synchronous round-trips burn 125 ms of pure network socket wait time.
  2. The WordPress Core #31245 alloptions Race Condition: Standard object cache drop-ins serialize every autoloaded wp_options row into one giant monolithic blob (options:alloptions). Under concurrent traffic, if Request A updates a WooCommerce transient while Request B updates a cron lock, one worker overwrites the other's serialized blob—causing mysterious lost settings, stuck cron jobs, and multi-megabyte network transfers on every single request.

ObjectCacheEngine.php was engineered from scratch to eliminate both bottlenecks across dedicated VPS clusters and restricted shared hosting alike—included 100% free in KadiCache Core.

7 Native Storage Drivers: From C-Level Relay Down to Shared-Hosting SQLite WAL#

Most WordPress object cache plugins hard-require phpredis and leave shared-hosting or container environments without C extensions stranded. ObjectCacheEngine implements a unified ObjectCacheBackendInterface backed by 7 purpose-built drivers under Cache/ObjectCache/Drivers/:

Driver ClassUnderlying EngineBest Deployment ScenarioKey Engineering Advantage
RelayDriverCacheWerk Relay (C-ext)High-concurrency NVMe / Redis / Valkey VPSShared in-PHP C memory + client-side invalidation with near-zero socket I/O
PhpRedisDriverext-redis (TCP / TLS / Unix Socket)Managed Cloudways, RunCloud, GridPane, AWS ElastiCacheNative C pipelining, Redis 6+ ACL auth, Redis Cluster {kc:prefix} hash tags & UNLINK
PhpStreamRedisDriverPure PHP RESP StreamDocker / cPanel hosts with Redis daemon but no ext-redisConnects over TCP or Unix domain sockets without requiring a compiled PHP C extension
MemcachedDriverext-memcachedSiteGround / multi-node Memcached poolsBinary protocol multi-get (getMulti) and SASL authentication
ApcuDriverext-apcu Shared RAMSingle-node LiteSpeed / Nginx / Apache serversSub-microsecond shared memory reads inside PHP-FPM with zero daemon overhead
SqliteDriverPDO_SQLite / SQLite3 (WAL)Shared hosting without Redis, Memcached, or APCuConcurrent PRAGMA journal_mode=WAL persistent object store on local NVMe disk
FileObjectDriverSharded Local FilesystemUniversal fallback on locked-down PHP 7.4+ hostsAtomic sharded binary files with OPcache-friendly config loading

When you leave Storage Backend Driver set to Auto-Detect Best Available, ObjectCacheConfig probes installed extensions and live daemons in priority order so your site automatically uses the fastest healthy backend available.

FIG 01Configuring Redis connection settings alongside 1-RTT Smart Route Prefetching and Atomic Split AlloptionsZoom 2x

1-RTT Smart Route Prefetching (MAX_PREFETCH_KEYS = 200)#

Instead of fetching keys one by one as WordPress hooks fire, ObjectCacheEngine fingerprints the current route ($this->resolveRouteId()) as soon as wp_start_object_cache() boots (and re-warms cleanly on switchToBlog() in early Multisite routing).

Atomic split_alloptions Shield, O(1) Epoch Flushes & 5-Second Circuit Breaker#

Three additional safeguards inside ObjectCacheEngine.php protect production WooCommerce stores under heavy write load:

  • Atomic Split Alloptions (split_alloptions): Instead of storing options:alloptions as a single fragile serialized string, getAllOptions() stores autoloaded options as individual hash fields and tracks baseline diffs per key. Concurrent updates to two different WordPress options never overwrite one another, and when Hybrid APCu L1 Hot-Options Turbo is enabled alongside Redis or SQLite, revision-verified alloptions reads resolve from local shared RAM without touching the socket.
  • Smart Binary Serialization & Compression (ObjectCacheSerializer.php): Automatically negotiates igbinary (falling back cleanly to tagged php serialization) and compresses payloads >= 256 bytes using the fastest installed codec (zstd -> lz4 -> lzf -> zlib) while keeping small integer counters uncompressed.
  • Non-Blocking O(1) Epoch Invalidation & Subsite Flushes: Calling wp_cache_flush() or wp kadicache object-cache flush --blog=3 increments a lightweight epoch counter ($this->epochs) and uses asynchronous UNLINK rather than blocking Redis's single-threaded event loop with FLUSHALL or KEYS * scans. On WordPress Multisite, flushing Blog #3 leaves Blog #1 and Blog #2 completely warm.
  • 5-Second Circuit Breaker (CIRCUIT_COOLDOWN_SECONDS = 5): If a Redis container restarts or a network socket times out, ObjectCacheEngine writes a lightweight local cooldown marker in sys_get_temp_dir() for 5 seconds and falls back immediately to in-memory $this->l1 execution instead of hanging every PHP worker on connection timeouts.

Atomic Drop-In Management & WP-CLI Operations#

Enabling Object Cache inside WP Admin -> KadiCache -> Object Cache runs a live pre-flight read/write probe (ObjectCacheEngine::probeConnection()) before ObjectCacheDropinManager writes wp-content/object-cache.php and OPcache-accelerated object-cache-config.php (with connection passwords excluded from JSON settings exports). You can manage every aspect from WP-CLI:

BASHManage & Benchmark Persistent Object Cache via WP-CLI
# Check drop-in ownership, active driver, serializer, compressor & hit ratio
wp kadicache object-cache status

# Probe backend latency (ms) and list top autoloaded wp_options offenders
wp kadicache object-cache info

# Enable with auto-detection or pin a specific driver (relay, phpredis, apcu, sqlite...)
wp kadicache object-cache enable --driver=auto

# Flush all entries in O(1) time, or flush a single Multisite blog ID
wp kadicache object-cache flush
wp kadicache object-cache flush --blog=2
Gergis — Lead Systems & Cache Architect
Principal WordPress & Cloud Edge Architect
E-E-A-T Source Verified

Creator of KadiCache’s Early PHP Drop-In, 7-Driver Object Cache Engine, Cloud Remove Unused CSS, and Zero-CLS Lazy Render pipeline.

apps/wordpress-plugin/src/Cache/ObjectCache/ObjectCacheEngine.phpapps/wordpress-plugin/src/Cache/ObjectCache/ObjectCacheSerializer.phpapps/wordpress-plugin/src/Cache/ObjectCache/AutoloadAnalyzer.phpapps/wordpress-plugin/src/Cache/ObjectCache/ObjectCacheDropinManager.phpapps/wordpress-plugin/src/Cli/ObjectCacheCli.php

Technical FAQ

Can I use persistent object caching on shared hosting that does not offer Redis or Memcached?

Yes. ObjectCacheEngine includes both an ApcuDriver (for single-server shared RAM) and a zero-daemon SqliteDriver running in WAL (Write-Ahead Logging) mode on local disk, plus a Sharded File fallback—working out of the box on standard PHP 7.4+ hosting.

What if my server runs a Redis daemon in Docker, but PHP does not have the phpredis C extension installed?

KadiCache ships PhpStreamRedisDriver, a native RESP stream client that connects to Redis or Valkey over TCP, TLS, or Unix domain sockets using pure PHP streams when ext-redis or Relay is absent.

What happens to my live WooCommerce checkout if the Redis service restarts?

ObjectCacheEngine enforces tight connection timeouts and a 5-second circuit breaker (CIRCUIT_COOLDOWN_SECONDS = 5). If Redis becomes unreachable, PHP immediately fails open to in-request L1 memory for 5 seconds rather than stalling every checkout request.

How does Atomic Split Alloptions prevent lost WordPress settings under high traffic?

Instead of reading and overwriting one giant serialized alloptions value—which suffers from race conditions (WordPress Core #31245) when two requests update different options concurrently—KadiCache splits autoloaded options into individual hash fields and writes only changed keys.

Will enabling KadiCache Object Cache overwrite an existing Redis Object Cache or Object Cache Pro drop-in?

Never without explicit consent. ObjectCacheDropinManager::ownsDropin() detects third-party object-cache.php files and operates in passive telemetry mode unless an administrator explicitly runs a backed-up takeover (--force-takeover).

Are Redis ACL passwords exported when I download a KadiCache settings JSON file?

No. Connection credentials live inside local OPcache-friendly object-cache-config.php / SecretBox storage and are stripped from portable JSON exports in WP Admin -> KadiCache -> Tools.

Does KadiCache Object Cache isolate subsites on WordPress Multisite and Redis Cluster?

Yes. Keys are scoped by installation prefix, blog_id, and epoch generation while honoring WordPress global groups (users, usermeta, sites, networks). Enabling cluster mode wraps the key root in Redis hash tags ({kc:prefix}) so multi-key MGET prefetches stay slot-safe.