• How to configure Drupal to use Memcached?

    In order to tell Drupal to make use of Memcached you first need to have Memcached installed on your server, then you need to follow the following steps:

    1. Download the memcache module from http://drupal.org/project/memcache

    2. Copy it to your sites/all/modules directory.

    3. Edit your settings.php file and add the following lines at the end:

    $conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
    
    $conf['cache_default_class'] = 'MemCacheDrupal';
    
    $conf['memcache_key_prefix'] = 'mysite_memcache';

    You can replace the "mysite_memcache" with anything you want, this is just the prefix to the memory objects memcached will use.

    Now you're Drupal site is using memcached and will run much faster.

    I hope you've enjoyed this tutorial and stay tuned for more to come.

    Share this post