Configure your website to use Memcached
After you've installed the daemon and installed the PHP libraries, you'll need to tell your PHP application to use Memcached. If you don't, Memcached will simply use server resources without providing any benefit.
Note: We strongly recommend that you create a backup of your site before making any of the changes outlined below.
WordPress
You can use Memcached by utilizing any number of WordPress caching plugins (this list is not all-inclusive).
-
W3 Total Cache Plugin
To configure, visit the Performance → General Settings page. Make sure the Enable box is checked and Memcached selected as the cache method for the following types of caching:
- Page Cache
- Database Cache
- Object Cache
- Fragment Cache
- Batcache Plugin
- Cachify Plugin
- Memcached-Redux
Joomla
Joomla supports Memcached without any additional extensions.
-
To activate it, open the site's configuration.php file, and look for these lines:
public $caching = '0'; public $cache_handler = 'file';
-
Change them to activate Memcached:
public $caching = '2'; public $cache_handler = 'memcached'; public $memcached_server_host = '127.0.0.1'; public $memcached_server_port = '11211';
- Save your changes.
Drupal
Memcached support can be added to Drupal by installing a Drupal Module.
Memcache API and Integration ModuleMagento
Memcached support is added to Magento by making changes to website configuration files.
-
To activate it, open the site's /app/etc/env.php file and look for these lines:
'session' => array ( 'save' => 'files', ),
-
Change them to activate Memcached:
'session' => array ( 'save' => 'memcached', 'save_path' => '127.0.0.1:11211' ),
- Save your changes.
Related Steps
- Return to Install the Memcached PHP Libraries using WHM.
- Return to Install the Memcached PHP Libraries using Plesk.
- Make sure Memcached is Working.
More info
- Our server experts can perform these steps for a fee. For more information about our Expert Services, please visit our Expert Service menu.