The "old method" for enabling memcache on the platform involved adding a configuration file in your codebase, and requiring it. The "new method"/best practice is to use a module to add the configuration file, so you can manage it using Composer.
This article is for you, if:
Overview. To use memcache in D9/D10 on the Acquia platform requires the Drupal memcache module (drupal/memcache, 8.x-2.0 or later; ideally the current version) and a current memcache configuration file. Note that the drupal/memcache module needs to be present, but does not need to be installed/enabled.
The memcache settings file can be added to your codebase manually (the old method), or by installing the acquia/memcache-settings module (the best practice method). Using the module is preferred, as it can be installed and updated using Composer.
Once the memcache config file has been added to the codebase, it needs to be required in settings.php, or in a custom settings file that is called from settings.php.
To require it in settings.php is the typical setup, but your site might have a custom settings file, such as 'acquia.settings.php' (which in turn is required in settings.php) that contains some platform-specific configuration such as requiring the memcache settings file.
Docs are here: https://docs.acquia.com/cloud-platform/performance/memcached/enable/ but here is some context and explanation, especially for a case where you are updating from an older configuration as opposed to installing memcache for the first time:
Enabling memcache for the first time. If your site doesn't use memcache now, best practice is:
Updating from an old configuration. If the site uses an older memcache settings file, the best practice is:
How to update the require line:
if (file_exists('/var/www/site-php')) { require('/var/www/site-php/mysite/mysite-settings.inc');[maybe some other things here]}
if (file_exists('/var/www/site-php')) { require('/var/www/site-php/mysite/mysite-settings.inc'); // Memcached settings for Acquia Hosting $memcache_settings_file = DRUPAL_ROOT . "/../vendor/acquia/memcache-settings/memcache.settings.php"; if (file_exists($memcache_settings_file)) { require_once $memcache_settings_file; }}
If you see any caching issues directly after updating and running drush cr, it might be necessary to flush memcache, although normally you shouldn't need to. See instructions here: https://acquia.my.site.com/s/article/360005311453-Memcache-monitoring-and-flush-using-the-nc-command
If this content did not answer your questions, try searching or contacting our support team for further assistance.
Fri Sep 12 2025 07:50:45 GMT+0000 (Coordinated Universal Time)