Hi, > Will the $cache2 potentially clean up the previous data stored by $cache1, > which should have a lifetime of 'null'? > I'm wondering if the lifetime is determined by the lifetime specified at the > value's storage, or at the instantiation of the cache handler.
It was the case at the very beginning of the File backend. But since ZF >= 1.5, the File backend stores the "expire" metadata with the record (at write time). So, IMHO, no problem with this configuration when using cleaning (CLEANING_MODE_OLD). Of course, not with CLEANING_MODE_ALL, CLEANING_MODE_MATCHING_TAG, CLEANING_MODE_NOT_MATCHING_TAG. if you want two completly independant cache system with the same backend : - use different "file_name_prefix" or - use different "cache_dir" Regards 2008/10/7 S. Alexandre M. Lemaire <[EMAIL PROTECTED]>: > Hi Everyone, > > > > Taking a peek at Zend Cache, seems like a useful mechanism. > > > > I have a question about the scope of duration though. > > > > If I do this: > > > > ** > > $cache1 = Zend_Cache::factory( > > 'Core', > > 'File', > > array( > > 'lifetime' => null, > > 'cache_id_prefix' => 'system', > > 'automatic_serialization' => > true > > ), > > array( > > 'cache_dir' => ROOT . 'cache/zend/' > > ) > > ); > > > > $cache1->save( 35, 'testdata' ); > > ** > > > > And then down the road.. I do this: > > > > ** > > $cache2 = Zend_Cache::factory( > > 'Core', > > 'File', > > array( > > 'lifetime' => 30, > > 'cache_id_prefix' => 'system', > > 'automatic_serialization' => > true > > ), > > array( > > 'cache_dir' => ROOT . 'cache/zend/' > > ) > > ); > > > > $cache2->save( 1, 'someotherdata' ); > > ** > > > > Will the $cache2 potentially clean up the previous data stored by $cache1, > which should have a lifetime of 'null'? > > > > I'm wondering if the lifetime is determined by the lifetime specified at the > value's storage, or at the instantiation of the cache handler. > > > > Thank you. > > Alexandre Lemaire > > Senior Architect/CEO, saeven.net consulting inc. > > [EMAIL PROTECTED] > > -- Fabien MARTY [EMAIL PROTECTED]
