In this tutorial, we will install and activate "MemcacheD Is Your Friend" on Wordpress to reduce the server load and improve the site speed.
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.
-
Login into your cPanel account
-
Go to Select PHP version
-
Enable memcache and memcached extensions
For more information about PHP Selector, please refer to the following article.
-
Login into your cPanel account
-
Go to Mocha Memcached
-
Click on Enable, then on Start
-
Login to your Wordpress admin dashboard
-
Go to Plguins
-
Click on Add New
-
In search form, type "MemcacheD Is Your Friend"
-
Click on Install Now, then Activate
-
Now, login into your cPanel account and open wp-config.php with cPanel file manager
-
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.
- You can view Memcached statistics from cPanel -> Mocha Memcached