Bug 7511 [ENH] Template caching (T::T feature)

Just add to your Koha configuration file
<template_cache_dir>/path/writable/by/apache/user</template_cache_dir>
in the <config> 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 <jcamins@cpbibliography.com>
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 <paul.poulain@biblibre.com>
This commit is contained in:
Paul Poulain 2012-02-10 09:45:34 +01:00
parent 858efb4886
commit 1161079e1f

View file

@ -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"