0

I use Structure for titles, breadcrumbs, nav, etc. I turned on debugging output, and it turns out titles (exp:structure:titletrail) and breadcrumbs (exp:structure:breadcrumb) are really performance intensive, taking my 1 second load to 2.x seconds, each getting the "warning/yellow background" in the EE load stack. Any suggestions on what I might do to tweak performance?

EDIT: The breadcrumb and titletrail tags now each add about 1.5 seconds to my page load time and 50MB in my template stack. I've since added several (like 200) more entries, making the total entries managed by Structure to several hundred. Oddly, the nav_advanced tag takes almost nothing.

Perhaps the amount of entries managed by Structure have something to do with this performance hit? I read on EE's Pages Module page that very few pages should be used with this. If Structure is based on Pages, does it also inherit this limitation?

2
  • 1
    Definitely make sure you are up to date on Structure. EE Harbor has finally gotten around to making some specific performance enhancement related to some slow queries. Not sure if it'd help you.
    – jrothafer
    Feb 19 '20 at 21:07
  • I have, but unfortunately that wasn't the issue. I've since replaced titletrail with just the title of the entry | channel | site, so I don't need that tag anymore. If I can't resolve this, I'm thinking of writing my own code to generate breadcrumbs, perhaps based on nav_advanced, which oddly is not impacted by this performance issue.
    – jphansen
    Apr 1 '20 at 1:40
0

I ended up performing the SQL query manually vs. calling the exp:structure:breadcrumbs tag. Takes almost no time.

<nav class="breadcrumbs">
        <ul class="breadcrumb">
            {exp:query sql="SELECT parent.lft, parent.rgt,expt.title, expt.entry_id, expt.url_title as bcurltitle, cd.field_id_32 as bcpage FROM exp_structure AS node, exp_structure AS parent INNER JOIN exp_channel_titles AS expt ON parent.entry_id = expt.entry_id INNER JOIN exp_channel_data_field_32 AS cd ON parent.entry_id = cd.entry_id WHERE node.lft BETWEEN parent.lft AND parent.rgt AND node.entry_id = '{entry_id}' AND expt.site_id = '1' ORDER BY parent.lft"}
                <li><a href="/{segment_1}/{bcurltitle}">{bcpage}</a></li>
            {/exp:query}
        </ul>
</nav>

If Structure performs better I'd prefer to use the breadcrumbs tag, but for now this is my solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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