This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

[LIVE WEBINAR] Don't fear downtime during a traffic surge! Discover the power of Autoscale on 28th Sept. Register Now →

How to Install Memcache on your Drupal 7 Site

Updated on December 9, 2021

3 Min Read

In my previous post, I showed you how to install and enable Redis cache on your Drupal 7 website hosted at Cloudways. However, that was just one way of speeding up your website. In this article, I will introduce Memcache, an alternate to to Redis that works equally well at speeding up your Drupal site. I will also discuss how to install Memcache on Drupal 7.

memcache on drupal 7 banner

Here’s what Wikipedia has to say about memcached: “Memcached (pronunciation: mem-cash-dee) 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.”

Memcache is different from Redis in that it is used to for object caching whereas Redis can be used as a DBMS as well as a server level cache. Given this, you can easily imagine the benefits of using both these caching options together.

Fortunately the process of setting up memcache on your Drupal website is super easy and involves the following steps:

  1. Install Memcache on Server
  2. Verify that Memcache is running on the Server
  3. Install the Memcache module in Drupal
  4. Edit settings.php
  5. Verify Memcache is active on your Drupal site

Install Memcache on Server

The first step is the installation of memcache on your server. The good news here is that Cloudways has memcache installed on your server by default so that you, the user, doesn’t have to go through the technical complexities of installing the service yourself.

Nothing as Easy as Deploying Drupal Apps on Cloud

With Cloudways, you can have your Drupal apps up and running on managed cloud servers in just a few minutes.

Verify that Memcache is running on the Server

To verify whether memcache is running on your server, first login to your Cloudways account and go to the server’s dashboard. From here, click on the Services tab in the left panel. You will be presented with a list of services running on the server. Locate memcache and confirm that the status is set to running.

cloudways services status

Install the Memcache Module in Drupal

Now that you have verified the status of the memcache service, it’s time to move on to the Drupal side of things.

As with every other extended functionality available for Drupal, memcache too has a dedicated module. Go to the module page and download it. Install it on your Drupal website and make sure it is enabled after installation.

Edit settings.php

Similar to Redis, you will be required to add a few lines to your Drupal site’s settings.php for memcache to work properly.

After you’ve successfully installed and enabled the memcache module on your site, navigate to the sites/default folder and add the following lines to settings.php file:

$conf['cache_backends'][] = 'sites/all/modules/memcache/';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';

Get Ready for Core Web Vitals Update

Ebook to Speed Up Your Website Before You Start Losing Traffic.

Thank You

Your list is on it’s Way to Your Inbox.

Verify Memcache is Active on your Drupal site

To check the status of memcache on your site, simply navigate to the admin panel and go to reports/memcache.


As you can see, Cloudways makes it incredibly easy to take advantage of the power of memcache for your Drupal site. You do not need to know Linux commands or server administration to get up and running with Cloudways.

If you need any help in how to installing memcache on Drupal 7, do leave a comment and i will get back to you ASAP!

Share your opinion in the comment section. COMMENT NOW

Share This Article

Hamza Zia

Hamza is a Drupal Community Manager at Cloudways - A Managed Drupal Hosting Platform. He loves to write about Drupal and related topics. During his free time, he can be seen obsessing over Football, Cars, Android and Gaming.


Get Our Newsletter
Be the first to get the latest updates and tutorials.

Thankyou for Subscribing Us!


Webinar: How to Get 100% Scores on Core Web Vitals

Join Joe Williams & Aleksandar Savkovic on 29th of March, 2021.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Want to Experience the Cloudways Platform in Its Full Glory?

Take a FREE guided tour of Cloudways and see for yourself how easily you can manage your server & apps on the leading cloud-hosting platform.

Start my tour
Unleash The Cloud.
Not Budgets.

For 4 Months +
Up To 30 Free Migrations

Cyber Week

Time Left In Offer
  • 0


  • 0


  • 0


  • 0


40% OFF

On All Plans