This article describes how to configure Magento to use memcached.
Memcached is an open-source memory object caching system that web sites can use to help accelerate page load times. Memcached works by caching in RAM frequently accessed data, such as the results of API calls, database calls, and more.
To enable memcached for Magento 2, you must change some settings in the env.php file. To do this, follow these steps:
'session' => [ 'save' => 'files' ],
Modify this section as follows:
'session' => [ array ( 'save' => 'memcached', 'save_path' => '127.0.0.1:11211' ), ],
Save your changes to the env.php file. Memcached is now enabled.
To enable memcached for Magento 1.9 and older versions, you need to add some settings to the local.xml file. To do this, follow these steps:
<cache> <backend>memcached</backend> <memcached> <servers> <server> <host><![CDATA[127.0.0.1]]></host> <port><![CDATA]></port> <persistent><![CDATA]></persistent> </server> </servers> <compression><![CDATA]></compression> <cache_dir><![CDATA]></cache_dir> <hashed_directory_level><![CDATA]></hashed_directory_level> <hashed_directory_umask><![CDATA]></hashed_directory_umask> <file_name_prefix><![CDATA]></file_name_prefix> </memcached> </cache>
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.