memcache or memcached autodetect object cache backend for wordpress
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
object-cache-memcached.php Create object-cache-memcached.php May 21, 2015

memcache or memcached autodetect object cache backend for wordpress


Memcachy is an object-cache for WordPress that auto-detects whether to use Memcached or Memcache. Also uses same config format for both. Useful if you locally develop with memcached and then for some reason the staging or prod server uses memcache.

Uses code from for the memcached part and from for the memcache part.


It's an object cache, not a plugin. You know what to do.

(Install the object-cache*-files to wp-content/.)


If your memcached server is running on localhost/ and port 11211 then you don't need any config at all. Hooray!

If your server is on another server/ip number then add a snippet like this to your wp-config.php:

$memcached_servers = array(


  • 29 april 2016: Update Memcached Object Cache to version 3
  • 2015: First version


  • Use same config format both both
  • Auto detect memcache or memcached

Other code used/attributions/credits

This is actually just a "wrapper" for these excellent plugins:

Memcached object cache by tollmanz:

Memcache object cache by ryan and sivel: