1
0

some more caching docs in smarty clas

This commit is contained in:
Ian
2011-11-30 18:40:28 +01:00
parent ce68df713b
commit ebb8777932

View File

@@ -174,11 +174,21 @@ class Serendipity_Smarty extends Smarty
* So each cache_id / compile_id combination may have their own cache lifetime. * 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, * 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 * it cannot be altered except for clearing and regenerating said cache file
*
* Template Inheritance
* Using is_cached() on sub-templates has to set up caching before is_cached() calls,
* e.g if (!$smarty->isCached('sub_test.tpl')) { $smarty->assign('foo', $foo); }.
* 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. #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->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_OFF; // $this->setCaching(Smarty::CACHING_OFF) // stop caching >= 3.1.4
/* /*
Note: rodneyrehm Note: rodneyrehm