1
0

S9y Smarty class: some more caching docs

This commit is contained in:
Ian
2011-11-30 17:19:24 +01:00
parent ce68df713b
commit 7fce1e47d8

View File

@ -174,11 +174,18 @@ class Serendipity_Smarty extends Smarty
* So each cache_id / compile_id combination may have their own cache lifetime.
* The point is simply, that once the cache lifetime (expiration date) has been saved to the cache file,
* it cannot be altered except for clearing and regenerating said cache file
*
* Using is_cached() on subtemplates has to set up caching before is_cached() calls.
* The subtemplate will always be cached as specified in the {include} tag. Otherwise you could never cache a subtemplate with caching disabled for the main template.
* If you don't want to have the main template cached, turn caching off again after the is_cached() calls for the subtemplate.
* So the example will cache sub_test.tpl but not test.tpl
* Use $smarty->caching = Smarty::CACHING_LIFETIME_SAVED; with {include file="sub_test.tpl" cache_lifetime="120"} in test.tpl;
* Use $smarty->caching = Smarty::CACHING_LIFETIME_CURRENT; with {include .... caching}
**/
#cache# $this->caching = Smarty::CACHING_LIFETIME_CURRENT; // $this->setCaching(2); // 1 will change the end of lifetime immediately.
// $this->caching = Smarty::CACHING_LIFETIME_SAVED; // $this->setCaching(Smarty::CACHING_LIFETIME_SAVED);
// $this->setCaching(Smarty::CACHING_OFF) // stop caching >= 3.1.4
# $this->caching = Smarty::CACHING_LIFETIME_SAVED; // $this->setCaching(Smarty::CACHING_LIFETIME_SAVED);
# $this->caching = Smarty::CACHING_OFF; // $this->setCaching(Smarty::CACHING_OFF) // stop caching >= 3.1.4
/*
Note: rodneyrehm