Improve Wordpress speed with Memcached

In this tutorial, we will install and activate "MemcacheD Is Your Friend" on Wordpress to reduce the server load and improve the site speed.

Install and activate "MemcacheD Is Your Friend"

Memcached is a general-purpose distributed memory caching system. It is often used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce the number of times an external data source (such as a database or API) must be read.

Activate Memcache and Memcached from PHP Selector

  1. Login into your cPanel account

  2. Go to Select PHP version

  3. Enable memcache and memcached extensions

For more information about PHP Selector, please refer to the following article.

Activate Memcached server for your account

  1. Login into your cPanel account

  2. Go to Mocha Memcached

  3. Click on Enable, then on Start

Activate MemcacheD Is Your Friend in WordPress

  1. Login to your Wordpress admin dashboard

  2. Go to Plguins

  3. Click on Add New

  4. In search form, type "MemcacheD Is Your Friend"

  5. Click on Install Now, then Activate

  6. Now, login into your cPanel account and open wp-config.php with cPanel file manager

  7. Add the following two lines before MySQL setting in wp-config.php

define('WP\_CACHE', true); $memcached\_servers = array( 'default' => array('/home/myuser/memcached.sock:0'));

Note: Replace /home/myuser/memcached.sock with the path to your memcached unix socket, it can be viewed from cPanel -> Mocha Memcached.

  1. You can view Memcached statistics from cPanel -> Mocha Memcached