We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17578
    • 33 Posts
    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
      • 30585
      • 833 Posts
      Quote from: ltdstylo at Mar 08, 2013, 04:45 PM
      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

      can you please post your calls?
        A MODx Fanatic
        • 42046
        • 436 Posts
        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.
          • 17578
          • 33 Posts
          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
            • 42046
            • 436 Posts
            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.
              • 17578
              • 33 Posts
              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
                • 42046
                • 436 Posts
                Try taking out &processTVList=`los-checkbox` also since you're not actually processing any TVs now.

                Glad it worked.
                  • 42046
                  • 436 Posts
                  Also if
                  <li><a href="[[~[[+id]]]]">[[+pagetitle]]</a></li>
                  is the extent of the output you don't need to use &includeContent=`1` , pagetitle and id are not classed as content.
                    • 17578
                    • 33 Posts
                    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