I have a zend cache which stores an array from the db. The cache can be read & updated fine. But the actual cache file seems to disappear after a day or so. I thought that adding automatic_cleaning_factor = 0
would solve this, but that doesn't seem to be the case.
$frontendOptions = array(
'caching' => true,
'cache_id_prefix' => 'mysite_blah',
'lifetime' => 14400, # 4 hours
'automatic_serialization' => true,
'automatic_cleaning_factor' => 0,
);
$backendOptions = array(
'cache_dir' => "{$_SERVER['DOCUMENT_ROOT']}/../../cache/zend_cache/"
);
$cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);
if(!$result = $cache->load('test_blah'))
{
// run SQL
...
$cache->save($my_array_from_db, 'test_blah');
}
else
{
$result = $cache->load('test_blah');
}
The page which uses this cache isn't very popular, not sure if that has anything to do with it..... Any ideas?