Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm actually trying to understand why memcached is not storing data for a given Id.

I'm using Magento EE that is based on Zend Framework 1.11.1.
The interface used to deal with Memcached is Zend_Cache_Backend_Memcached

Now there is not such big custom code here, this is my custom container that save the cache:

public function saveCache($blockContent)

    $lifeTime = 86400 * 30 * 6;
    $tags = array(
    $cacheId = $this->_getCacheId();

    if ($cacheId !== false) {
        $this->_saveCache($blockContent, $cacheId, $tags, $lifeTime);
    return $this;

I'm just forcing Magento to use my custom cache tag and a fixed lifetime ( Memcached doesn't support custom tag so I guess this is not the problem ) also my lifetime is not used in Memcached because I can see that the default one is used.

At the beginning I thought the issue was caused by a to long cache ID but now after reducing it ( <31 char ) this didn't help me:

I can see that the load() method Zend_Cache_Backend_Memcached return always false for my cache ids. While the save() method return true like if it was cached.

This is my local.xml configuration:



I also tried to check the entry of memcached to see if my id was stored or not with this command:

echo 'stats cachedump 35 35' | sudo nc -U /tmp/memcached.sock

  • Any idea about the reason of this ?
  • How can I debug it ? ( I cannot go under Zend_Cache_Backend_Memcached with xdebug)

There also a small things I don't understand:

  • Even if I specify my <cache_lifetime> in my placeholder config that value is not used ? ( that is why I'm overriding the save() method )
share|improve this question
Be careful with <hashed_directory_umask><![CDATA[]]></hashed_directory_umask>. It's been replaced with hashed_directory_perm in later version of Zend (and therefore Magento.) – Tyler V. Jun 6 '14 at 23:56

here the issue is $lifetime and a relative bug in Zend_Cache_Backend_Memcached.

Memcached has a max lifetime of 30 days (2592000) so the limit I was using it was too big and that is why the data was not stored.


  1. Zend_Cache_Backend_Memcached::save() doesn't check if the limit is correct < 2592000

  2. the set() method on the memcached object return true even if it doesn't store the data $result = @$this->_memcache->set($id, array($data, time(), $lifetime), $flag, $lifetime);

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.