Plugin info

Total downloads: 173,834
Active installs: 20
Total reviews: 29
Average rating: 3.8
Support threads opened: 1
Support threads resolved: 0 (0%)
Available in: 8 language(s)
Contributors: 18
Last updated: 11/8/2022 (1149 days ago)
Added to WordPress: 12/19/2005 (20 years old)
Minimum WordPress version: 5.3
Tested up to WordPress version: 6.1.9
Minimum PHP version: 5.6.20

Maintenance & Compatibility

Maintenance score

Possibly abandoned • Last updated 1149 days ago • Support resolved 0% • 29 reviews

16/100

Is Memcached Object Cache abandoned?

Possibly abandoned (last update 1149 days ago).

Compatibility

Requires WordPress: 5.3
Tested up to: 6.1.9
Requires PHP: 5.6.20

Similar & Alternatives

Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.

Object Cache 4 everyone
Rating 4.3/5 (28 reviews)Active installs 5,000
MemcacheD Is Your Friend
Rating 4.5/5 (8 reviews)Active installs 2,000
WP-FFPC
Rating 4.8/5 (42 reviews)Active installs 1,000
Use Memcached
Rating 4.0/5 (4 reviews)Active installs 1,000
Batcache
Rating 4.5/5 (2 reviews)Active installs 900
Cache Master
Rating 4.8/5 (16 reviews)Active installs 600

Description

Memcached Object Cache provides a persistent backend for the WordPress object cache. A memcached server and the PECL memcache extension are required.

Installation

  1. Install memcached on at least one server. Note the connection info. The default is 127.0.0.1:11211.

  2. Install the PECL memcache extension

  3. Copy object-cache.php to wp-content

  4. Add the WP_CACHE_KEY_SALT constant to the wp-config.php:

    php
    define( 'WP_CACHE_KEY_SALT', '...long random string...' );

This helps prevent cache pollution when multiplte WordPress installs are using the same Memcached server. The value must be unique for each WordPress install.

Frequently Asked Questions

How can I manually specify the memcached server(s)?

Add something similar to the following to wp-config.php above /* That's all, stop editing! Happy blogging. */:

$memcached_servers = array(
    'default' => array(
        '10.10.10.20:11211',
        '10.10.10.30:11211'
    )
);

The top level array keys, are cache groups, where ‘default’ corresponds to any cache group that is not explicitly defined. This allows for specifying memcached servers that only handle certain cache groups. The most common use is only specifying ‘default’.

Possible cache groups are:

{$taxonomy}_relationships
{$meta_type}_meta
{$taxonomy}_relationships
blog-details
blog-id-cache
blog-lookup
bookmark
calendar
category
comment
counts
general
global-posts
options
plugins
post_ancestors
post_meta
posts
rss
site-lookup
site-options
site-transient
terms
themes
timeinfo
transient
user_meta
useremail
userlogins
usermeta
users
userslugs
widget

Review feed

Rafael Angeline
11/1/2016

Works perfectly!

Hi! It works out-of-box, just added the file and done! Awesome work here! Only had to replace the constructor name at 424 to -> function __construct() - so we avoid a Warning at PHP7, for example. Kind Regards, Rafael
Zumbo
11/15/2022

Working Perfectly

Download zip. Upload object-cache.php file (not memcached folder, only object-cache.php) to wp-content folder (not plugins folder). Add define('WP_CACHE_KEY_SALT','RANDOM SALT KEY'); to wp-config.php Add $memcached_servers = array( 'default' => array( '127.0.0.1:11211' ) ); to wp-config.php done.
Daschmi
12/1/2022

Fatal error

Not working PHP8
Alex Volkov
2/3/2023

Fatal error

Fatal error: Cannot redeclare wp_cache_add() (previously declared in /home/accessib/public_html/wp-includes/cache.php:41) in /public_html/wp-content/plugins/memcached/object-cache.php on line 19

Screenshots

No screenshots available

Changelog

4.0.0

  • Add preemptive filter pre_wp_cache_get
  • Add flush_number replication to prevent accidental flush due to flush_number eviction, server rotation, etc.

3.2.2

  • Remove filter, and base key stripping on presence of key_salt

3.2.1

  • Fix bug allowing slow-ops entries to have the same key, so toggling doesn’t work

3.2.0

  • Better stats(). Now shows cache group/individual calls with size of the payload and timings.
  • PHP 5.6.20 is now required
  • Fix get_multi to show per group calls
  • Added filter (memcached_strip_keys) to bypass memcached key stripping
  • Special group for slow-ops ( > 5ms ) with backtrace

3.1.0

  • Add wp_cache_get_multi
  • Add support for the $found parameter
  • Set a variable for $max_expiration to 30 days
  • Code style changes
  • Different coloring for unknown stats group
  • Store host/port on failure_callback
  • Default stats counts

3.0.2

  • Better output of HTML

3.0.1

  • Fix key generation error in switch_to_blog()

3.0.0

  • Flush site cache by rotating keys
  • Flush global cache when flushing main site

2.0.6

  • Flush the local cache on wp_cache_flush()

2.0.5

  • Fix missing global in switch_to_blog

2.0.4

  • Remove deprecated constructor

2.0.3

  • Support for unix sockets

2.0.2

  • Break references by cloning objects
  • Keep local cache in sync with memcached when using incr and decr
  • Handle limited environments where is_multisite() is not defined
  • Fix setting and getting 0
  • PHP 5.2.4 is now required
  • Use the WP_CACHE_KEY_SALT constant if available to guarantee uniqueness of keys