ZF-5733: Add setLifeTime into the cache class

Issue Type: Improvement Created: 2009-02-10T09:23:04.000+0000 Last Updated: 2009-04-09T00:14:41.000+0000 Status: Resolved Fix version(s): - 1.7.8 (30/Mar/09)

Reporter: Puli Kutya (puli) Assignee: Fabien MARTY (fab) Tags: - Zend_Cache

Related issues: Attachments:


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.

<pre class="highlight">
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().') ';


Posted by Fabien MARTY (fab) on 2009-02-10T11:01:15.000+0000

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 ! :-)

Posted by Fabien MARTY (fab) on 2009-02-10T13:58:50.000+0000

sorry, I read too fast your issue

I didn't see you talk about the Page frontend

Posted by Fabien MARTY (fab) on 2009-04-09T00:14:41.000+0000

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

<pre class="highlight">
$cache->end(array(), 3600);

array() is an optional array of tags

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.