I have a channel listing characters in a TV show. On the index page of that channel, I display a visual index to all characters. The index looks like this and it uses Solspace's Tags module to pick out the image for each character:

{exp:channel:entries channel="{current_channel}" limit="500" orderby="title" sort="asc" disable="member_data|pagination"}
<div class="CharIndexItem">
<div class="CharIndexImage">
{embed="Characters/Snippet_Image_index_GoT" character="{title}" byname="{{current_channel_id}_byname}" actor="{{current_channel_id}_actor_name}"}
<div class="CharIndexText"><a href="{comment_url_title_auto_path}">{title}</a></div>

And the embed like this:

{exp:tag:entries channel="channel42" limit="1" tag="{embed:character} Index"}
<a href="{comment_entry_id_auto_path}"><img src="{42_image:small}" border="0" title="{embed:character}{if embed:byname != ""}, {embed:byname}{/if}{if embed:actor != ""}, played by {embed:actor}{/if}" /></a>

Now, since the show has a lot of characters, that index ends up with a lot of embeds. Right now it isn't a problem, but the site gets hit with very heavy traffic when the show is on air, so I am thinking it may cause an issue then. Is there any way to cut back on these embeds? I do need to stay with Tags as the method of marking the images that get used for each character, it is the only workflow that really makes sense.

  • 1
    Have you thought about using Stash for this?
    – Natetronn
    Dec 1, 2012 at 22:58
  • I am not familiar with Stash, I will have a look into it, thanks. :) Dec 1, 2012 at 23:04

3 Answers 3


If performance is only a problem when the site gets hit by a lot of traffic, you might want to turn on caching for that particular tag (I'm not really a fan of full page caching). That is what it is meant for...

{exp:channel:entries cache='yes' refresh='60' ...}

Might I ask why you have at all? You shouldn't need it since you are not nesting the same tags... if it is because you use this snippet in multiple places, might I suggest using a snippet?

– Wouter

  • The channel:entries pair shares variables with tag:entries, so using tag:entries in the same template did not pass the correct values to it. So it does seem like it needs to broken out, at least per Solspace's support. Dec 1, 2012 at 23:19
  • In that case, caching the entire tag would be your best bet: {exp:channel:entries cache='yes' refresh='60' ...} (refresh is in minutes). Dec 1, 2012 at 23:22
  • Alright, thanks. :) From reading a bit, I had thought that avoiding embeds at all costs was the thing to focus on, but just caching the tag seems like the easier approach. Dec 2, 2012 at 9:47
  • Well... cutting down on the number of embeds and minimizing caching is 'the best way' (there is no right way in EE), but as a quick fix caching can be helpful. If you ever have the time I'd suggest finding other ways of solving your performance problems, just to further your understanding of how EE handles things. This way you can avoid these issues in future projects. Dec 12, 2012 at 17:11

There's also a few other, more effective ways to cache code chunks like that such as CE Cache or Template Morsels.

  • 1
    In this case it would be better to simply turn on caching for the embed templates. Dec 2, 2012 at 6:35

The easiest thing to do in this case I would recommend simply turning on caching for the embed templates. You will need to specify how long cached versions of the embeds should be saved.

You could also make sure on my CacheCracker add-on to help manage and expire the cached template's data automatically when publishing new entries in the associated channels.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.