From 2bea3e2abd44e07198199eb9ac86aebc4c3f0f2a Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Tue, 6 Mar 2012 12:05:35 -0500 Subject: Bug 732189 - Backport 731562 to bmo: Cache the global/user.html.tmpl template, r=glob https://bugzilla.mozilla.org/show_bug.cgi?id=731562 --- Bugzilla/Template.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Template.pm') diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index a1a6944f0..f069b19d2 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -938,7 +938,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, -- cgit v1.2.3-24-g4f1b