Hi All,
I've created a template that uses 5 getresources calls to load a sidebar nav that filters resources from 1 container using a tvFilter. It works, but it's SLOW. I've set the getresources calls to uncached which has marginally sped things up but it's not acceptable (14+ seconds). Has anyone else experienced this before and found a solution? Would Wayfinder make more sense? If so can &where be used to filter a TV?
Thanks in advance for any insight.
I'm running MODX Revolution 2.2.6-pl (traditional)
R
If not doing so already, try using includeTVList/processTVList to limit TVs if there are other ones in the child resources that aren't needed for the sidebar display. I've found it can significantly speed up load times.
Thanks for the responses.
The first getresources calls all:
[[getResources? &hideContainers=`1` &showHidden=`1` &depth=`0` &resources=`` &parents=`16` &sortby=`menuindex` &sortdir=`ASC` &includeTVs=`1` &processTVs=`1` &tvPrefix=`` &limit=`80` &tpl=`single-team-sidebar-item`]]
The four remaining are as follows with the only difference being the &tvFilters:
[[getResources? &hideContainers=`1`&depth=`0` &includeContent=`1` &parents=`16` &sortby=`menuindex` &sortdir=`ASC` &includeTVs=`1` &processTVs=`1` &tvFilters=`los-checkbox==%dev%` &showHidden=`1` &tvPrefix=`` &limit=`60` &tpl=`single-team-sidebar-item`]]
The single-team-sidebar-item is :
<li><a href="[[~[[+id]]]]">[[+pagetitle]]</a></li>
I'm going to try includeTVList/processTVList and let you know what the result is.
R
I don't think you need to include any TVs in the first call.
Second one try adding &includeTVList=`los-checkbox` and also possibly not processing the TVs.
I think that did it! The new call for the filtered items is:
[[getResources? &hideContainers=`1`&depth=`0` &includeContent=`1` &parents=`16` &sortby=`menuindex` &sortdir=`ASC` &includeTVs=`1` &includeTVList=`los-checkbox` &processTVList=`los-checkbox` &tvFilters=`los-checkbox==%dev%` &showHidden=`1` &tvPrefix=`` &limit=`60` &tpl=`single-team-sidebar-item`]]
page loads are down to between 1 and 3 seconds.
This is a HUGE help, and a good lesson in how to optimize getresources.
Thanks so much for your help.
R
Try taking out &processTVList=`los-checkbox` also since you're not actually processing any TVs now.
Glad it worked.
I saw that and took it out as well. This is what happens when you're lazy and copy and paste your getresources from other templates. Thanks again