Memcached and WordPress

Increase your caching game with memcached on WordPress.

We’ll be using the LEMP stack setup in

Install the memcached service and PHP extension:

yum install -y memcached php70u-pecl-memcached

Enable and start the memcached service:

systemctl enable memcached
systemctl start memcached

Reload the PHP-FPM and Nginx services:

systemctl restart php-fpm
systemctl reload nginx

In order for WordPress to take advantage of memcached you will need to install a memcached compatible plugin, in this case we’ll be using W3 Total Cache.
1. Install the plugin via the WordPress administrator backend.
2. Configure the plugin to use memcached where applicable:

That’s it! Memcached should now be working.
You can verify it’s working by using the following command and reloading your WordPress site:

watch "echo stats | nc 11211"

Leave a Reply

Your email address will not be published. Required fields are marked *