- From: Ville Skytta via cvs-syncmail <cvsmail@w3.org>
- Date: Sat, 20 Aug 2005 10:58:34 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv26550/httpd/cgi-bin
Modified Files:
Tag: validator-0_7-branch
check
Log Message:
Use file based template caching if Storable is available.
Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.432.2.1
retrieving revision 1.432.2.2
diff -u -d -r1.432.2.1 -r1.432.2.2
--- check 15 Aug 2005 22:47:51 -0000 1.432.2.1
+++ check 20 Aug 2005 10:58:32 -0000 1.432.2.2
@@ -273,21 +273,32 @@
my $lang = 'en_US'; # @@TODO: conneg;
+my %cache_opts = ();
+if (eval { require Storable }) {
+ %cache_opts = (
+ file_cache => TRUE,
+ file_cache_dir => File::Spec->catdir(File::Spec->tmpdir(), 'validator'),
+ );
+}
+
my $T = HTML::Template->new(
filename => File::Spec->catfile($CFG->{Paths}->{Templates},
$lang, 'result.tmpl'),
die_on_bad_params => FALSE,
loop_context_vars => TRUE,
+ %cache_opts,
);
my $E = HTML::Template->new(
filename => File::Spec->catfile($CFG->{Paths}->{Templates},
$lang, 'fatal-error.tmpl'),
die_on_bad_params => FALSE,
+ %cache_opts,
);
my $H = HTML::Template->new(
filename => File::Spec->catfile($CFG->{Paths}->{Templates},
$lang, 'http_401_authrequired.tmpl'),
die_on_bad_params => FALSE,
+ %cache_opts,
);
$File->{T} = $T;
@@ -303,6 +314,7 @@
$T->param(cfg_home_page => $CFG->{'Home Page'});
undef $lang;
+undef %cache_opts;
#########################################
# Populate $File->{Opt} -- CGI Options. #
Received on Saturday, 20 August 2005 10:58:40 UTC