Index: Zend/Cache/Backend/APC.php =================================================================== --- Zend/Cache/Backend/APC.php (revision 1315) +++ Zend/Cache/Backend/APC.php (working copy) @@ -104,11 +104,12 @@ * @param string $data datas to cache * @param string $id cache id * @param array $tags array of strings, the cache record will be tagged by each string entry + * @param integer $lifetime how long this item should be cached, if null, then use the global lifetime * @return boolean true if no problem */ - public function save($data, $id, $tags = array()) + public function save($data, $id, $tags = array(), $lifetime = null) { - $result = apc_store($id, array($data, time()), $this->_directives['lifeTime']); + $result = apc_store($id, array($data, time()), (is_null($lifetime) ? $this->_directives['lifeTime'] : $lifetime)); if (count($tags) > 0) { if ($this->_directives['logging']) { Zend_Log::log("Zend_Cache_Backend_APC::save() : tags are unsupported by the APC backend", Zend_Log::LEVEL_WARNING); Index: Zend/Cache/Backend/File.php =================================================================== --- Zend/Cache/Backend/File.php (revision 1315) +++ Zend/Cache/Backend/File.php (working copy) @@ -197,9 +197,10 @@ * @param string $data datas to cache * @param string $id cache id * @param array $tags array of strings, the cache record will be tagged by each string entry + * @param integer $lifetime how long this item should be cached, if null, then use the global lifetime * @return boolean true if no problem */ - public function save($data, $id, $tags = array()) + public function save($data, $id, $tags = array(), $lifetime = null) { clearstatcache(); $file = $this->_file($id); Index: Zend/Cache/Backend/Interface.php =================================================================== --- Zend/Cache/Backend/Interface.php (revision 1315) +++ Zend/Cache/Backend/Interface.php (working copy) @@ -64,9 +64,10 @@ * @param string $data datas to cache * @param string $id cache id * @param array $tags array of strings, the cache record will be tagged by each string entry + * @param integer $lifetime how long this item should be cached, if null, then use the global lifetime * @return boolean true if no problem */ - public function save($data, $id, $tags = array()); + public function save($data, $id, $tags = array(), $lifetime = null); /** * Remove a cache record Index: Zend/Cache/Backend/Memcached.php =================================================================== --- Zend/Cache/Backend/Memcached.php (revision 1315) +++ Zend/Cache/Backend/Memcached.php (working copy) @@ -163,16 +163,17 @@ * @param string $data datas to cache * @param string $id cache id * @param array $tags array of strings, the cache record will be tagged by each string entry + * @param integer $lifetime how long this item should be cached, if null, then use the global lifetime * @return boolean true if no problem */ - public function save($data, $id, $tags = array()) + public function save($data, $id, $tags = array(), $lifetime = null) { if ($this->_options['compression']) { $flag = MEMCACHE_COMPRESSED; } else { $flag = 0; } - $result = $this->_memcache->set($id, array($data, time()), $flag, $this->_directives['lifeTime']); + $result = $this->_memcache->set($id, array($data, time()), $flag, (is_null($lifetime) ? $this->_directives['lifeTime'] : $lifetime)); if (count($tags) > 0) { if ($this->_directives['logging']) { Zend_Log::log("Zend_Cache_Backend_Memcached::save() : tags are unsupported by the Memcached backend", Zend_Log::LEVEL_WARNING); Index: Zend/Cache/Backend/Sqlite.php =================================================================== --- Zend/Cache/Backend/Sqlite.php (revision 1315) +++ Zend/Cache/Backend/Sqlite.php (working copy) @@ -146,9 +146,10 @@ * @param string $data datas to cache * @param string $id cache id * @param array $tags array of strings, the cache record will be tagged by each string entry + * @param integer $lifetime how long this item should be cached, if null, then use the global lifetime * @return boolean true if no problem */ - public function save($data, $id, $tags = array()) + public function save($data, $id, $tags = array(), $lifetime = null) { if (!$this->_checkStructureVersion()) { $this->_buildStructure(); @@ -158,10 +159,12 @@ } $data = @sqlite_escape_string($data); $mktime = time(); - if (is_null($this->_directives['lifeTime'])) { + if (!is_null($lifetime)) { + $expire = $mktime + $lifetime; + } elseif (!is_null($this->_directives['lifeTime'])) { + $expire = $mktime + $this->_directives['lifeTime']; + } else { $expire = 0; - } else { - $expire = $mktime + $this->_directives['lifeTime']; } @sqlite_query($this->_db, "DELETE FROM cache WHERE id='$id'"); $sql = "INSERT INTO cache (id, content, lastModified, expire) VALUES ('$id', '$data', $mktime, $expire)"; Index: Zend/Cache/Backend/Test.php =================================================================== --- Zend/Cache/Backend/Test.php (revision 1315) +++ Zend/Cache/Backend/Test.php (working copy) @@ -148,9 +148,10 @@ * @param string $data datas to cache * @param string $id cache id * @param array $tags array of strings, the cache record will be tagged by each string entry + * @param integer $lifetime how long this item should be cached, if null, then use the global lifetime * @return boolean true if no problem */ - public function save($data, $id, $tags = array()) + public function save($data, $id, $tags = array(), $lifetime = null) { $this->_addLog('save', array($data, $id, $tags)); if ($id=='false') {