EEConf 2024 is around the corner! EEConf 2024
I have a page that worked fine till I’ve added a relationship field to it - as I need to get content from another channel. The page loads in 0.4s without the relationship field, but when I add it to the page it slows down to around 10 seconds.
The relationship field mentioned above is limited to 1 entry, the channel that it pulls content from is also limited to one entry, but even if it wasn’t, I have no idea why it slows the page down so much.
The code looks like this:
{exp:channel:entries channel="main" disable="categories|pagination|member_data|category_fields"}
stuff here from main channel...
{product_of_the_month limit="1" dynamic="no" disable="categories|pagination|member_data|category_fields"}
...stuff here from product of the month...
{/product_of_the_month}
...continue with stuff from main channel
{/exp:channel:entries}
I have removed all categories from the channels used on the page as I thought that might slow it down, but it did not help at all. What am I doing wrong here?
Hi Adambada,
Thanks for getting in touch base about this. What version of ExpressionEngine are you currently running? Also roughly how many entries does the product_of_the_month channel have in it?
We really haven’t run into (or seen) performance issues on this side of relationships, although we did recently push a performance update to relationships live, specific to the CP interface when there were over 10,000 entries in a relationship.
Thanks,
-Tom Jaeger
Hi Tom,
Its ee version 6.2.7, and the product of the month channel contains 1 entry - I’ve even limited the number of fields the channel has to the bare minimum required to display, around 6-7 fields, so nothing crazy.
I do have another channel that I will have to include later on with relationship field - that will have dozens of entries, which I’ve also tried while testing and it takes roughly the same time to display as the channel with only 1 entry.
I also have to mention that channel works fine when its not requested through the relationship field type (eg. used on the product’s own review page)
ok, this issue has a very obvious pattern, now I’ve replaced ee with an earlier one - 6.1.6 - and it seems like it is faster than both versions I mentioned above. Still not lightning-fast, but better. Something got messed up in the recent updates with either relationship fields or calling channel:entries tags on pages. The earlier the version I try the faster the whole site becomes.
Hi Adambadam,
Thanks for passing this along… We haven’t seen reports of it on the front end at all.
In our internal discussion on this, we’re wondering if you see a significant difference in the query count from 6.1.6 to 6.3.x?
We’re actually JUST about to kickoff a fairly large performance scope, so we put this on the radar for that scope.
Thanks, if it’s easy to pass along query count or other info that would be awesome!
-Tom Jaeger
Hi Tom,
Now that is something I can’t check for you as I only have one version at a time (and I also don’t know how to get that or where to be honest). Can you think of anything that can cause templates to slow down that might be something outside of relationship fields or multiple channel:entries calls on a page.
My setup looks something like this:
pages add-on
entries contain about 50 fields (which does not seem to be an issue when I directly show everything on a “product” page, but it does cause issues when its requested through relationship field, or with channel:entries tag on a different page with more channel:entries tags)
no insane amount of entries (slows down requesting info from channel that has 1 entry and another one that has 4 entries, this is troubling as currently its just setting up the site, there will be dozens of entries for one of the channels when the site goes live)
no embeds no layouts in templates
the pages suffering have around 7-8 channel:entries tags, most of them from one channel, 2-3 from other channels (this was option A ive tried)
the pages have just the bare minimum number of channel:entries tags with a few relationship fields replacing more content from other channels (this was option B ive tried)
I do have lots of categories, but also tried removing all and the slowdown was the same without them
After i’ve experimented with every possible solution I could come up with, I tried the newer and the older ee versions. That is where I’m at now.
As an alternative option, you might consider fetching just the entry IDs for relationship field, and then using those as parameter for separate channel:entries loop (you’ll likely need to use template embedding)
https://docs.expressionengine.com/latest/fieldtypes/relationships.html#fetching-entry-ids-only
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.