I'm actually trying to understand why memcached does not store data for an identifier.
I am using Magento EE 1.11.2.0 based on Zend Framework 1.11.1. The interface used to work with memcached is Zend_Cache_Backend_Memcached
Now there is no such big custom code here, this is my custom container that saves the cache:
public function saveCache($blockContent) { $lifeTime = 86400 * 30 * 6; $tags = array( My_Module_Model_PageCache_Container_Category_Blabla::CACHE_TAG ); $cacheId = $this->_getCacheId(); if ($cacheId !== false) { $this->_saveCache($blockContent, $cacheId, $tags, $lifeTime); } return $this; }
I just force magento to use my custom cache tag and fixed lifetime (memcache does not support the special tag, so I think this is not a problem), also my lifetime not used in memcached because I see that it is used by default.
At the beginning, I thought that the problem was caused by a long cache identifier, but now after its reduction (<31 char) this did not help me:
I see that the load() method of Zend_Cache_Backend_Memcached always returns false for cache identifiers. Although the save() method returns true, as if it were cached.
This is my local.xml configuration:
<cache> <slow_backend_store_data>1</slow_backend_store_data> <auto_refresh_fast_cache>0</auto_refresh_fast_cache> <backend>memcached</backend> <slow_backend>database</slow_backend> <memcached> <servers> <server> <host><![CDATA[unix:///tmp/memcached.sock]]></host> <port><![CDATA[0]]></port> <persistent><![CDATA[0]]></persistent> <weight><![CDATA[2]]></weight> <timeout><![CDATA[5]]></timeout> </server> </servers> <compression><![CDATA[0]]></compression> <hashed_directory_level><![CDATA[]]></hashed_directory_level> <hashed_directory_umask><![CDATA[]]></hashed_directory_umask> <file_name_prefix><![CDATA[]]></file_name_prefix> </memcached> </cache> <full_page_cache> <backend>memcached</backend> <slow_backend>database</slow_backend> <slow_backend_store_data><![CDATA[1]]></slow_backend_store_data> <memcached> <servers> <server> <host><![CDATA[unix:///tmp/memcached.sock]]></host> <port><![CDATA[0]]></port> <persistent><![CDATA[0]]></persistent> <weight><![CDATA[2]]></weight> <timeout><![CDATA[10]]></timeout> <retry_interval><![CDATA[10]]></retry_interval> <status><![CDATA[1]]></status> <stats_update_factor><![CDATA[1]]></stats_update_factor> </server> </servers> </memcached> </full_page_cache>
I also tried checking the memcached entry to see if my id was saved or not using this command:
echo 'stats cachedump 35 35' | sudo nc -U /tmp/memcached.sock
- Any idea on the reason for this?
- How can I debug it? (I cannot go under
Zend_Cache_Backend_Memcached using xdebug)
source share