Skip to content
SHOPAII

Memcached Object Cache for wordpress

wordpress · Published · 1 min read

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' ) );


Related posts