ZF-5733: Add setLifeTime into the cache class


A setLifeTime() method would be very-very handful to change the lifetime without initialize a new cache object. At the moment we must have as much cache object as much lifetime we want use instead of using one cache object.

if(!$cache->start('mypage')) {
        echo 'This is cached with init lifetime ('.time().') ';

$cache->setLifeTime( 3 );

if(!$cache->start('mypage2')) {
        echo 'This is cached with 3 seconds lifetime ('.time().') ';


please have a look at the API :…

you can specify an alternative lifetime in the save method or you can use the setLifetime() method which... already exists ! :-)

sorry, I read too fast your issue

I didn't see you talk about the Page frontend

in the current version, you can pass a specificLifetime for the end() method

$cache->end(array(), 3600);

array() is an optional array of tags