Memcached Object Cache

Updated on 10. 2. 2026



Memcached Object Cache

Overview

Memcached object cache stores WordPress objects in Memcached to reduce database load. ZiziCache supports both PHP extensions: memcached (modern) and memcache (legacy).

Requirements

  • PHP extension: memcached or memcache.
  • Write access to wp-content/ (for object-cache.php drop-in).
  • Write access to wp-config.php (for server list and optional credentials).

Enable in the UI

  1. Open ZiziCache Memcached.
  2. Enter servers (one per line): host:port or unix:///path/to/socket.
  3. Optional: set key salt and SASL credentials (if your Memcached server requires them).
  4. Click Test Connection, then enable Memcached.

What ZiziCache changes

  • Installs wp-content/object-cache.php from a backend-specific template.
  • Writes $memcached_servers and optional constants (key salt, SASL credentials, timeouts) to wp-config.php.

Connection testing and safety

  • Connection tests are rate-limited (per user, 5minute window).
  • Server addresses are validated to reduce SSRF/portscan abuse.

WP-CLI

# Flush object cache (backend-agnostic)
wp zizi-cache object-cache-flush

REST API

  • GET /wp-json/zizi-cache/v1/memcached-status
  • POST /wp-json/zizi-cache/v1/memcached-test
  • POST /wp-json/zizi-cache/v1/memcached-flush
  • GET /wp-json/zizi-cache/v1/memcached-environment

Backend selection

  • If memcached is available, it is preferred.
  • If only memcache is available, ZiziCache uses it automatically.

Mutual exclusivity

Only one object cache backend can be active at a time. Enabling Memcached disables Redis and vice versa.

What are your feelings