m***@comcast.net
2009-03-24 20:37:32 UTC
as a new user to html::templates i've found it pretty easy to use but
quite slow. i've turned on cache'ing but there is still no
improvement and apache's log indicates that the files are being loaded
each time. so, what am i doing wrong? i've included the perl code i
use to create the template and the results shown in apache's log.
this shows, i believe, that each file is being loaded each time it's
referenced. it also shows another problem, that i encounter every so
often, that the file can't be found when, in fact, it's there. if i
simply reload the page the file is found the 2nd time. very confusing.
any help is greatly appreciated.
thanks,
tom
code snippet:
$tmpl = new HTML::Template(filename => "$page.html",
die_on_bad_params => 1, cache => 1, cache_debug => 1);
/var/log/apache2/error_log
[Tue Mar 24 14:06:11 2009] [notice] Apache/2.2.9 (Unix) PHP/5.2.6
mod_perl/2.0.2 Perl/v5.8.8 configured -- resuming normal operations
[Tue Mar 24 14:06:26 2009] [error] [client 127.0.0.1] ###
HTML::Template Cache Debug ### CACHE LOAD : main.html =>
2f37e6f23ab3b64bc5f135082a0bdd86, referer: http://xwww.meds4vets.biz/index.pl
[Tue Mar 24 14:06:34 2009] [error] [client 127.0.0.1] ###
HTML::Template Cache Debug ### CACHE LOAD : main.html =>
2f37e6f23ab3b64bc5f135082a0bdd86, referer: http://xwww.meds4vets.biz/index.pl?page=logout
[Tue Mar 24 14:06:45 2009] [error] [client 127.0.0.1] ###
HTML::Template Cache Debug ### CACHE LOAD : aboutus.html =>
ffcd98c513174dbb29b79e75747db33f, referer: http://xwww.meds4vets.biz/index.pl?page=login
[Tue Mar 24 14:06:57 2009] [error] [client 127.0.0.1] ###
HTML::Template Cache Debug ### CACHE LOAD : aboutus.html =>
ffcd98c513174dbb29b79e75747db33f, referer: http://xwww.meds4vets.biz/index.pl
[Tue Mar 24 14:07:05 2009] [error] [client 127.0.0.1] ###
HTML::Template Cache Debug ### CACHE LOAD : products_01.html =>
e5f8705ae116b48a34bf98650f2f0d91, referer: http://xwww.meds4vets.biz/index.pl?page=aboutus
[Tue Mar 24 14:07:13 2009] [error] [client 127.0.0.1] ###
HTML::Template Cache Debug ### CACHE LOAD : products_02.html =>
c4627d7e66e4f65f5a00bec98907dd5b, referer: http://xwww.meds4vets.biz/index.pl?page=products_01
[Tue Mar 24 14:07:22 2009] [error] [client 127.0.0.1] ###
HTML::Template Cache Debug ### CACHE LOAD : products_03.html =>
d9c4c240921ca93f2e302fdf56e01904, referer: http://xwww.meds4vets.biz/index.pl?page=products_02&name_id=000001
[Tue Mar 24 14:07:33 2009] [error] [client 127.0.0.1] ###
HTML::Template Cache Debug ### CACHE LOAD : products_02.html =>
c4627d7e66e4f65f5a00bec98907dd5b, referer: http://xwww.meds4vets.biz/index.pl?page=products_03
[Tue Mar 24 14:08:33 2009] [error] [client 127.0.0.1] HTML::Template-
[Tue Mar 24 14:08:33 2009] [error] [client 127.0.0.1]
\tHTML::Template::_init_template('HTML::Template=HASH(0x8b60f0)')
called at /Library/Perl/5.8.8/HTML/Template.pm line 1238, referer: http://xwww.meds4vets.biz/index.pl
[Tue Mar 24 14:08:33 2009] [error] [client 127.0.0.1]
\tHTML::Template::_init('HTML::Template=HASH(0x8b60f0)') called at /
Library/Perl/5.8.8/HTML/Template.pm line 1124, referer: http://xwww.meds4vets.biz/index.pl
[Tue Mar 24 14:08:33 2009] [error] [client 127.0.0.1]
\tHTML::Template::new('HTML::Template', 'filename',
'products_01.html', 'die_on_bad_params', 0, 'cache', 1, 'cache_debug',
1, ...) called at /var/vhosts/meds4vets.biz/www/index.pl line 162,
referer: http://xwww.meds4vets.biz/index.pl
[Tue Mar 24 14:09:02 2009] [error] [client 127.0.0.1] ###
HTML::Template Cache Debug ### CACHE LOAD : products_01.html =>
e5f8705ae116b48a34bf98650f2f0d91
tourists don't know where they've been. travelers don't know where
they're going. -- paul theroux
quite slow. i've turned on cache'ing but there is still no
improvement and apache's log indicates that the files are being loaded
each time. so, what am i doing wrong? i've included the perl code i
use to create the template and the results shown in apache's log.
this shows, i believe, that each file is being loaded each time it's
referenced. it also shows another problem, that i encounter every so
often, that the file can't be found when, in fact, it's there. if i
simply reload the page the file is found the 2nd time. very confusing.
any help is greatly appreciated.
thanks,
tom
code snippet:
$tmpl = new HTML::Template(filename => "$page.html",
die_on_bad_params => 1, cache => 1, cache_debug => 1);
/var/log/apache2/error_log
[Tue Mar 24 14:06:11 2009] [notice] Apache/2.2.9 (Unix) PHP/5.2.6
mod_perl/2.0.2 Perl/v5.8.8 configured -- resuming normal operations
[Tue Mar 24 14:06:26 2009] [error] [client 127.0.0.1] ###
HTML::Template Cache Debug ### CACHE LOAD : main.html =>
2f37e6f23ab3b64bc5f135082a0bdd86, referer: http://xwww.meds4vets.biz/index.pl
[Tue Mar 24 14:06:34 2009] [error] [client 127.0.0.1] ###
HTML::Template Cache Debug ### CACHE LOAD : main.html =>
2f37e6f23ab3b64bc5f135082a0bdd86, referer: http://xwww.meds4vets.biz/index.pl?page=logout
[Tue Mar 24 14:06:45 2009] [error] [client 127.0.0.1] ###
HTML::Template Cache Debug ### CACHE LOAD : aboutus.html =>
ffcd98c513174dbb29b79e75747db33f, referer: http://xwww.meds4vets.biz/index.pl?page=login
[Tue Mar 24 14:06:57 2009] [error] [client 127.0.0.1] ###
HTML::Template Cache Debug ### CACHE LOAD : aboutus.html =>
ffcd98c513174dbb29b79e75747db33f, referer: http://xwww.meds4vets.biz/index.pl
[Tue Mar 24 14:07:05 2009] [error] [client 127.0.0.1] ###
HTML::Template Cache Debug ### CACHE LOAD : products_01.html =>
e5f8705ae116b48a34bf98650f2f0d91, referer: http://xwww.meds4vets.biz/index.pl?page=aboutus
[Tue Mar 24 14:07:13 2009] [error] [client 127.0.0.1] ###
HTML::Template Cache Debug ### CACHE LOAD : products_02.html =>
c4627d7e66e4f65f5a00bec98907dd5b, referer: http://xwww.meds4vets.biz/index.pl?page=products_01
[Tue Mar 24 14:07:22 2009] [error] [client 127.0.0.1] ###
HTML::Template Cache Debug ### CACHE LOAD : products_03.html =>
d9c4c240921ca93f2e302fdf56e01904, referer: http://xwww.meds4vets.biz/index.pl?page=products_02&name_id=000001
[Tue Mar 24 14:07:33 2009] [error] [client 127.0.0.1] ###
HTML::Template Cache Debug ### CACHE LOAD : products_02.html =>
c4627d7e66e4f65f5a00bec98907dd5b, referer: http://xwww.meds4vets.biz/index.pl?page=products_03
[Tue Mar 24 14:08:33 2009] [error] [client 127.0.0.1] HTML::Template-
new() : Cannot open included file products_01.html : file not found.
at /Library/Perl/5.8.8/HTML/Template.pm line 1658, referer: http://xwww.meds4vets.biz/index.pl[Tue Mar 24 14:08:33 2009] [error] [client 127.0.0.1]
\tHTML::Template::_init_template('HTML::Template=HASH(0x8b60f0)')
called at /Library/Perl/5.8.8/HTML/Template.pm line 1238, referer: http://xwww.meds4vets.biz/index.pl
[Tue Mar 24 14:08:33 2009] [error] [client 127.0.0.1]
\tHTML::Template::_init('HTML::Template=HASH(0x8b60f0)') called at /
Library/Perl/5.8.8/HTML/Template.pm line 1124, referer: http://xwww.meds4vets.biz/index.pl
[Tue Mar 24 14:08:33 2009] [error] [client 127.0.0.1]
\tHTML::Template::new('HTML::Template', 'filename',
'products_01.html', 'die_on_bad_params', 0, 'cache', 1, 'cache_debug',
1, ...) called at /var/vhosts/meds4vets.biz/www/index.pl line 162,
referer: http://xwww.meds4vets.biz/index.pl
[Tue Mar 24 14:09:02 2009] [error] [client 127.0.0.1] ###
HTML::Template Cache Debug ### CACHE LOAD : products_01.html =>
e5f8705ae116b48a34bf98650f2f0d91
tourists don't know where they've been. travelers don't know where
they're going. -- paul theroux