cache lifetime bug

From: Date: Mon, 08 Apr 2002 10:44:52 +0000
Subject: cache lifetime bug
Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-48@lists.php.net to get a copy of this message
hi, #1 cache_lifetime bug there is a bug in cache_lifetime handling in function _read_cache_file: cache will never get expired, if a cache_lifetime > 0 is set: : if ($this->cache_lifetime < 0 &&
:     (time()- $this->_cache_info['timestamp'] > $this->cache_lifetime))
should be : if ($this->cache_lifetime < 0 ||
:     (time()- $this->_cache_info['timestamp'] > $this->cache_lifetime))
the bug was introduced in Smarty 2.0 #2 cache_lifetime values and documentation i know cache handling for cache_lifetime = 0 has changed several times in the past currently the comment near the variable definition is: // number of seconds cached content will persist. // 0 = never expires. default is one hour (3600) IMO the definition of a cache_lifetime *has* to be: 1. > 0 caching for the appropriate lifetime 2. = 0 no caching 3. < 0 never expire (usually cache_lifetime = -1) andreas -- andreas kossmeier bergfex.at - http://www.bergfex.at

« previous php.smarty.dev (#48) next »