[htmltmpl] Caching in html-template
Brought to you by:
samtregar
From: <hat...@tu...> - 2004-09-14 08:25:40
|
Hello html-template-users, I don't know anything about how html-template caches its templates. I'm using file_cache, and I have many templates for different modules. I have two ways for handling it: 1. main.tmpl: <TMPL_INCLUDE "some_header.html"> <TMPL_IF _MODULE_MODULE1><TMPL_INCLUDE "modules/module1.tmpl"></TMPL_IF> <TMPL_IF _MODULE_MODULE2><TMPL_INCLUDE "modules/module2.tmpl"></TMPL_IF> ... <TMPL_INCLUDE "some_footer.html"> and perl code like this: my $tmpl = HTML::Template->new( ... filename => 'main.tmpl', file_cache => 1, file_cache_dir => './cache/' ); $tmpl->param("_MODULE_$current_module" => 1); 2. main.tmpl: <TMPL_INCLUDE "some_header.html"> <TMPL_VAR MODULE_OUTPUT> <TMPL_INCLUDE "some_footer.html"> and perl code like this: my $tmpl = HTML::Template->new( ... filename => 'main.tmpl', file_cache => 1, file_cache_dir => './cache/' ); my $mod_tmpl = HTML::Template->new( ... filename => $module_tmpl, file_cache => 1, file_cache_dir => './cache/' ); $tmpl->param(MODULE_OUTPUT => $mod_tmpl->output()); so, the question is: is there a difference in this methods when caching? and what is better? (maybe there is a third way). thanks. -- Best regards, Горький Юрий mailto:hat...@tu... |