Low Search is being loaded when I don't want it and slowing down my site
Via the template debugger, we can see that when we use {exp:playa:parents}, Low Search is getting loaded for some reason AND is adding 1.5 - 2 seconds of load time to our pages.
Here's an example of template code:
{exp:channel:entries channel="products" url_title="{last_segment}"}
{exp:playa:parents channel="videos"}
{/exp:playa:parents}
{/exp:channel:entries}
This results in the following in the Template Debugger:
(0.184545 / 4.39MB) Calling Class/Method: Playa/parents
(0.184680 / 4.39MB) -> Class Called: Playa
(0.184734 / 4.39MB) -> Method Called: parents
(2.150174 / 20.03MB) Calling Extension Class/Method: Low_search_ext/channel_entries_query_result
You can see Low Search is taking two seconds to load, but I'm not calling Low Search anywhere in the template! Why is it being loaded and how to we prevent this??
Replies
Low 3 Dec 2012 22:45
Actually, it's the Playa tag that's taking that long. As you can see in the log, the timer is at 0.184737 when the playa:parents method is called. The next time a line is added to the template log, the time is 2.150174. That's the time the Low Search extension hook is called, not when it's done. So that means, until the that line was added, it took almost 2 seconds to get there: the playa:parents method.
The hook is called, because Low Search uses that hook, but it bails out as soon as it notices there wasn't a search performed. (most likely, the number after that final row you copied over isn't that much higher than the 2.15 second mark.)
Dustin Hansen 3 Dec 2012 23:46
Thanks for the quick response. I'll hit up Pixel & Tonic for more info.