Long page wait times

I’m still getting long waiting times on page loads. At worst I’m getting a 21 sec lag which just shows in waterfall as wait time

Once the wait time is over the page loads really quickly.
On that page I’m using liquid to scroll through events and count how many are available for each location (locations are filtered by north and south). Support have suggested taking that out but I need that functionality.

Is there a better way to construct my liquid to minimise the wait time?

Hi @doodlefish. Can you confirm that if removing the counter loop (temporarily) does indeed resolve the performance issue?

Hi Adam - yes taking this from the page drops the load wait time to 527 ms - really fast in comparison. The only thing I removed was this
{% component source: “Event”, limit: “300”, object: “collection”, collectionVariable: “eventlist”, type: “module” %}

but of course it doesn’t show the number of events at each location any more.

How many Events are there?
From what I can see, it shouldn’t really be that much of a load on the system and there isn’t an excessive number of items.

If, on a new test page, you place the Event component and just the second forloop, does that test page load slowly too?

So on the page you’d just have:

{% component source: "Event", limit: "300", object: "collection", collectionVariable: "eventlist", type: "module" %}

{% assign count = 0 %}
{% for e in eventlist.items %}
    {% if e.location2 == i.id %}
    {% assign count = count | plus: e.capacity | minus: e.allocation %}
    {% endif %}
{% endfor %}
1 Like

Thanks Adam - I just tested this. Using just your code bought the wait time down to 9sec loading time. When I add the full code (which is in the vi-Book Inspection snippet) its waiting for 18 to 20 seconds.
We do run a lot of events - currently 137 and I recently got Treepl services to add liquid to determine 2 calendars, one for 1 hour appts and one for 30 min appts. All events are input in 30 min timeslots

Hi @doodlefish,

We’ve made events output optimization to your site, please check.