Update: This post about Memcache config for Magento 1.3 AND 1.4 is a bit outdated. Please also have a look at: Willem’s update on two-level caching.

Memcache config: how to finally do it

We’ve been experimenting with the memcache settings for Magento for a while now. The configuration syntax for memcached in Magento is a bit difficult, but doable. This has resulted in:

  1. documentation about configuring memcached for Magento for our customers (dutch)
  2. a configuration tool that configures memcached for Magento automatically
  3. and even a way to protect your site in the event the memcache daemon goes down by providing a fallback for the memcached backend! (bit of dutch)

With the recent release of Magento 1.4, this has changed a lot for our tools. We’re trying to make them compatible with 1.3 and 1.4, but it’s a bit difficult. We found no references to the configuration syntax and the Magento error messages haven’t been very helpful.

We found one obscure link though: http://www.magentocommerce.com/boards/viewthread/80506

This set our path:Memcached

It didn’t work though 🙂 Magento kept connecting to localhost, while our memcached for shared Magento runs on a local socket! But fortunately, after some hunting through the gazillion classes we found the correct app/etc/local.xml syntax for Magento 1.4:

Yes, that is correct, you need to specify the settings three times!

Fortunately, these settings for memcached are backwards compatible with Magento 1.3 🙂

We’ve now updated our SmartCache tool to work for both 1.4 and 1.3.
PS: Don’t forget to apply our memcached fallback patch 🙂

Scan je eigen Magento shop op veiligheidslekken