From 99583fe461267ecd84bab9f5092361697713f208 Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Fri, 10 Feb 2012 09:45:34 +0100 Subject: [PATCH] Bug 7511 [ENH] Template caching (T::T feature) Just add to your Koha configuration file /path/writable/by/apache/user in the block, and Koha will use template caching, for about 10% CPU time saving. on linux servers, /tmp is usually OK (also fixes an indenting with a TAB) Signed-off-by: Jared Camins-Esakov The results of using this are very striking. Based on an insufficient sample size, it would seem that the time spent in T::T is reduced by a factor of at least 5. Signed-off-by: Paul Poulain (cherry picked from commit 1161079e1f14c681e82e139e72291af35d6f9b98) Signed-off-by: Chris Nighswonger --- C4/Templates.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/Templates.pm b/C4/Templates.pm index d150a16f1e..0741040492 100644 --- a/C4/Templates.pm +++ b/C4/Templates.pm @@ -53,12 +53,13 @@ sub new { else { $htdocs = C4::Context->config('intrahtdocs'); } - my ($theme, $lang)= themelanguage( $htdocs, $tmplbase, $interface, $query); my $template = Template->new( { EVAL_PERL => 1, ABSOLUTE => 1, - PLUGIN_BASE => 'Koha::Template::Plugin', + PLUGIN_BASE => 'Koha::Template::Plugin', + COMPILE_EXT => C4::Context->config('template_cache_dir')?'.ttc':'', + COMPILE_DIR => C4::Context->config('template_cache_dir')?C4::Context->config('template_cache_dir'):'',, INCLUDE_PATH => [ "$htdocs/$theme/$lang/includes", "$htdocs/$theme/en/includes" -- 2.39.5