ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

really slow loading template... help?

July 27, 2011 9:30am

Subscribe [3]
  • #1 / Jul 27, 2011 9:30am

    meredithmarsh

    44 posts

    I don’t know if you can tell from looking at it, but this template loads REALLY slow. Sometimes I get an error if it takes more than 90 seconds to load.

    I’ve copy and pasted just the section that is causing the slowness. If anyone can see anything goofy with my code that might be the problem, I’d appreciate it!


    {exp:channel:entries channel="register" url_title="{segment_2}” limit=“1”}     
      {exp:user:stats}
      {exp:user:is_mine member_id="{member_id}”}
      {if mine}

      <section id=“sponsorships_to_date”>     

    My sponsorships to date

      <table cellpadding=“10px”>
     
      <tr>
      <td width=20%>Sponsor Name</td>
      <td width=20%>Sponsor Email</td>
      <td width=10%>Amount</td>
      <td width=20%>Recv’d</td>
     
      </tr>
      {/exp:user:is_mine}
      {/exp:user:stats}
    {/exp:channel:entries} 
         
    {exp:channel:entries channel="sponsor" limit="500" dynamic="off" sort="asc" orderby="title"}
      {exp:user:stats}
      {exp:user:is_mine member_id="{member_id}”}
      {if sponsor_participant == "{segment_2}”}

      <tr>
      <td width=“30%” id=“my_sponsor_name”>
      {if member_group == "1"}
      {sponsor_name}
      {if:else}
      {sponsor_name}
      {/if}
      </td>
      <td width=“30%” id=“my_sponsor_email”>{sponsor_email_address}</td>
      <td width=“20%” id=“my_sponsor_amount”>
      {if sponsor_amount == "0"}
      pending
      {/if}
      {if sponsor_amount != "0"}
      $ {sponsor_amount}
      {/if}
      </td>
      <td width=“20%” id=“my_sponsor_status”>
      {if sponsor_status != ""}
      {site_url}sys/style/images/Tick.png
      received
      {/if}
     
      {if sponsor_email_address != ""}
      online
      {/if}
     
      </td>
      </tr>
     

      {/if}

    {/exp:user:is_mine}
    {/exp:user:stats} </table>
    {/exp:channel:entries}

  • #2 / Jul 27, 2011 9:52am

    Brad Morse

    428 posts

    add disable, cache, and refresh parameters to your exp:channel:tries tags.

  • #3 / Jul 27, 2011 10:07am

    johndwells

    94 posts

    In addition to what Brad has recommended, I would say your nested order is to blame - your exp:user:stats is getting called up to 500 times within your second exp:channel:entries tag pair, when it really only needs to be called once (at least I think).  So try something like:

    {exp:user:stats}
    {exp:channel:entries ...}
    ...
    {/exp:channel:entries}
    {/exp:user:stats}

    Cheers,
    John

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases