Smarty caching
Posted on December 10th, 2009 in Smarty 3 | No Comments »
Smarty3 introduced a concept of template and data objects which can have a parent child relationship.
For this an additional parameter ‘parent’ was introduced which did change the parameter order of fetch and display to
($template, $parent = null, $cache_id = null, $compile_id = null)
So
$oSmarty->fetch ( $sTemplateName . ‘.tpl’, null, $iTemplateId )
should work.
NOCACHE attribute in include {include nocache}
The “nocache” in the {include} does tell Smarty that the content of the subtemplate shall not be merged into the cache file of main.tpl. The subtemplate creates it’s own cache file (which can have nocached sections). The cached content and rendered content of the nocache sections of the subtemplate is inserted into the output of the cached main.tpl each time the page is called.



