0

I have a class that loads the Mage::app()->getCache(), and call the cache methods.

Well this is working very well for Files. I can load and read. But when I switch to Memcached in local.xml, the cache stops working. And I have no errors, no warnings. But updating Zend_Cache_Core::_options['logging'] to true, I see this message:

WARN (4): Zend_Cache_Core::save() / write_control : written and read data do not match

IMPORTANT: Frontend and Session cache works like a charm. What could be happening?

EDIT: I was logging Zend_Cache_Backend_Memcached and discovered that when I call my save method...

$cache = Mage::app()->getCache();
$cache->save('my_value', 'my_id', array(), 3600);

...the last one Lifetime was being converted to string. I don't know when it happens in ZF but omitting Lifetime solved my problem:

$cache->save('my_value', 'my_id', array());
0

Write control is a method that reads back what it has just written, so that consistency is guaranteed. If the data read back does not match what was written, it will in fact issue a remove request.

This is counterproductive with replicated setups. So if your MemCache instance is replicated (ask your hoster if you don't know), it's possible that the data has not yet arrived at the slave node.

You can turn it off in your local.xml, from the top of my head it's a backend option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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