summaryrefslogtreecommitdiffstats
path: root/template/en/default/attachment/list.html.tmpl
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2012-03-01 23:24:08 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2012-03-01 23:24:08 +0100
commit670ea222ff6b4e7b1d544c939972a7252665e3fc (patch)
tree5c85767377c76d389a203cc4ccdd5e67a332eff5 /template/en/default/attachment/list.html.tmpl
parent2e3a5735240ad3bc777e245bf1ce1505e3579fda (diff)
downloadbugzilla-670ea222ff6b4e7b1d544c939972a7252665e3fc.tar.gz
bugzilla-670ea222ff6b4e7b1d544c939972a7252665e3fc.tar.xz
Bug 731562: Cache the global/user.html.tmpl template for improved performance
r=dkl a=LpSolit
Diffstat (limited to 'template/en/default/attachment/list.html.tmpl')
-rw-r--r--template/en/default/attachment/list.html.tmpl10
1 files changed, 9 insertions, 1 deletions
diff --git a/template/en/default/attachment/list.html.tmpl b/template/en/default/attachment/list.html.tmpl
index 5bcda0a46..e30492c36 100644
--- a/template/en/default/attachment/list.html.tmpl
+++ b/template/en/default/attachment/list.html.tmpl
@@ -51,6 +51,7 @@ function toggle_display(link) {
[% count = 0 %]
[% obsolete_attachments = 0 %]
+ [% user_cache = template_cache.users %]
[% FOREACH attachment = attachments %]
[% count = count + 1 %]
@@ -89,7 +90,14 @@ function toggle_display(link) {
title="Go to the comment associated with the attachment">
[%- attachment.attached FILTER time %]</a>,
- [% INCLUDE global/user.html.tmpl who = attachment.attacher %]
+ [%# No need to recreate the exact same template if we already have it. %]
+ [% attacher_id = attachment.attacher.id %]
+ [% UNLESS user_cache.$attacher_id %]
+ [% user_cache.$attacher_id = BLOCK %]
+ [% INCLUDE global/user.html.tmpl who = attachment.attacher %]
+ [% END %]
+ [% END %]
+ [% user_cache.$attacher_id FILTER none %]
</span>
</td>