diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2012-03-01 23:24:08 +0100 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2012-03-01 23:24:08 +0100 |
commit | 670ea222ff6b4e7b1d544c939972a7252665e3fc (patch) | |
tree | 5c85767377c76d389a203cc4ccdd5e67a332eff5 /Bugzilla/Template.pm | |
parent | 2e3a5735240ad3bc777e245bf1ce1505e3579fda (diff) | |
download | bugs-670ea222ff6b4e7b1d544c939972a7252665e3fc.tar bugs-670ea222ff6b4e7b1d544c939972a7252665e3fc.tar.gz bugs-670ea222ff6b4e7b1d544c939972a7252665e3fc.tar.bz2 bugs-670ea222ff6b4e7b1d544c939972a7252665e3fc.tar.xz bugs-670ea222ff6b4e7b1d544c939972a7252665e3fc.zip |
Bug 731562: Cache the global/user.html.tmpl template for improved performance
r=dkl a=LpSolit
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r-- | Bugzilla/Template.pm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index dcbe37b3f..78c537cc3 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -912,7 +912,15 @@ sub create { Bugzilla->fields({ by_name => 1 }); return $cache->{template_bug_fields}; }, - + + # A general purpose cache to store rendered templates for reuse. + # Make sure to not mix language-specific data. + 'template_cache' => sub { + my $cache = Bugzilla->request_cache->{template_cache} ||= {}; + $cache->{users} ||= {}; + return $cache; + }, + 'css_files' => \&css_files, yui_resolve_deps => \&yui_resolve_deps, |