ZF-7691: Zend_Cache clean() does not work


I'm trying to remove a cache with a specific tag. the clean()-method returns true, but the cache file gets not deleted or cleared.

How I save the cache: Someone is looking at a database record over a controller, i'm generating a individualy cache-id with some params. I start a new cache block and call it with $cache->end(array('tag', 'tag2'); When I'm going to save the existing database record i want to delete the cache. So I build up a new instance of the cache object in my model, and search for matching cache-ids.

my code looks like this:

$cacheIds = $cache->getIdsMatchingTags(array($this->getId()));
foreach ($cacheIds as $cacheId) {

I don't know what to do else? I think that is a problem with Zend_Cache, r/w permissions are set cause i can write the cache on the given path.


Can you specify your Backend type and options? i.e. Xcache, Memcache , File etc.


$config = Zend_Registry::get('config')->cache; $cache = Zend_Cache::factory( $config->frontend, $config->backend, $config->frontendOptions->toArray(), $config->backendOptions->toArray());

I think this issue may be similar to ZF-5740.

I suggest the following code:

$result = ($result) && $this->remove($id);

should be:

$res = $this->remove($id);
$result = $result && $res;


$result = $this->remove($id) && $result;

Solved in SVN r17867