-
Notifications
You must be signed in to change notification settings - Fork 3
Object Cache
WordPress has built-in object caching but, object cache is non-persistent by default. This means that data stored in the cache resides in memory only and only for the duration of the request. Powered Cache comes with three different object cache backend to saving persistent.
Requirements: A memcached server and the PECL memcache extension.
Memcache Backend uses 127.0.0.1 as default memcached server. If you want to use different server, small modification needed.
Add something similar to the following to wp-config.php
$memcached_servers = array( 'default' => array( '10.10.10.20:11211', '10.10.10.30:11211' ) );
if you want to separate caching by group try something like;
$memcached_servers = array( 'default' => array( '10.10.10.20:11211', '10.10.10.30:11211' ), 'options' => array('10.10.10.40:11211');
Same configuration with Memcache, only difference is, it uses "Memcached" extension of PHP not Memcache.
Requirements: Redis server and phpredis extension.
edit wp-config.php to add your redis credentials (authentication is turned off by default, you can add 'auth' key and value if needed)
$redis_server = array( 'host' => '127.0.0.1', 'port' => 6379, 'database' => 0 );
For more detail about object caching: https://codex.wordpress.org/Class_Reference/WP_Object_Cache