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 /template/en/default/bug | |
parent | 2e3a5735240ad3bc777e245bf1ce1505e3579fda (diff) | |
download | bugzilla-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/bug')
-rw-r--r-- | template/en/default/bug/comments.html.tmpl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl index d6a9fcca2..0bdb37586 100644 --- a/template/en/default/bug/comments.html.tmpl +++ b/template/en/default/bug/comments.html.tmpl @@ -46,6 +46,7 @@ [% DEFAULT start_at = 0 mode = "show" %] [% sort_order = user.settings.comment_sort_order.value %] +[% user_cache = template_cache.users %] [%# NOTE: (start_at > 0) means we came here from a midair collision, # in which case we don't care what the user's preference is. @@ -170,12 +171,18 @@ </span> <span class="bz_comment_user"> - [% INCLUDE global/user.html.tmpl who = comment.author %] + [%# No need to recreate the exact same template if we already have it. %] + [% commenter_id = comment.author.id %] + [% UNLESS user_cache.$commenter_id %] + [% user_cache.$commenter_id = BLOCK %] + [% INCLUDE global/user.html.tmpl who = comment.author %] + [% END %] + [% END %] + [% user_cache.$commenter_id FILTER none %] </span> <span class="bz_comment_user_images"> - [% FOREACH group = comment.author.groups %] - [% NEXT UNLESS group.icon_url %] + [% FOREACH group = comment.author.groups_with_icon %] <img src="[% group.icon_url FILTER html %]" alt="[% group.name FILTER html %]" title="[% group.name FILTER html %] - [% group.description FILTER html %]"> |