- optimization on cache update when main template is modified

This commit is contained in:
Uwe Tews
2015-05-05 15:46:24 +02:00
parent 914815d438
commit d7ff1eec47
3 changed files with 8 additions and 2 deletions

View File

@@ -1,6 +1,9 @@
 ===== 3.1.22-dev ===== (xx.xx.2015)
05.05.2015
- bugfix code could be messed up when {tags} are used in multiple attributes https://github.com/smarty-php/smarty/issues/23
- optimization on cache update when main template is modified
05.05.2015
- bugfix code could be messed up when {tags} are used in multiple attributes https://github.com/smarty-php/smarty/issues/23
04.05.2015
- bugfix Smarty_Resource::parseResourceName incompatible with Google AppEngine (https://github.com/smarty-php/smarty/issues/22)

View File

@@ -111,7 +111,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = '3.1.22-dev/24';
const SMARTY_VERSION = '3.1.22-dev/25';
/**
* define variable scopes

View File

@@ -138,6 +138,9 @@ class Smarty_Template_Cached
} else {
$cached->valid = true;
}
if ($cached->valid && $_template->source->timestamp > $cached->timestamp) {
$cached->valid = false;
}
if ($cached->valid && $_template->caching == Smarty::CACHING_LIFETIME_CURRENT && $_template->cache_lifetime >= 0 && time() > ($cached->timestamp + $_template->cache_lifetime)) {
// lifetime expired
$cached->valid = false;