From a79d50a42bdd90361608618b47191038feeb40b3 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 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) --- C4/Templates.pm | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/Templates.pm b/C4/Templates.pm index d150a16..0741040 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" -- 1.7.5.4