We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2690
    • 148 Posts
    Not sure if it was discussed here before, but i find this a bit excessive:

    Before Ditto snippet: <!-- Queries: 15 | Query Time: 0.0075 s | Parse Time: 0.1778 s | Total Time: 0.1852 s | Source: database -->

    After Ditto Snippet: <!-- Queries: 708 | Query Time: 0.0917 s | Parse Time: 0.2408 s | Total Time: 0.3325 s | Source: database -->

    The snippet call used in the above example:
    [[Ditto? &parents=`52` &depth=`3` &summarize=`2` &hideFolders=`0` &showInMenuOnly=`1` &seeThruUnpub=`0` &tpl=`Ditto_Hotspot` &sortBy=`pub_date` &sortDir=`DESC` &filter=`featuredTHS,1`]]


    I have some pages with 2 or even 3 ditto calls, multiplying the number of queries by the number of calls.

    Is this normal? Any optimization hints? I know, there is cache, but i is there anything i can do to decrease that initial number?


    Thanks,

    Aleks
      MODx Revo 2.0.6-pl (Traditional) | Apache 2.2.3 | PHP 5.2.14 | MySQL 5.0.77 | MAC OS 10.6.5 | FF 3.6/Chrome 9.0.5
      • 11975
      • 2,542 Posts
      Hi,

      first of all, be sure to use the Version 2.0.
      The 2.0 branches is far better from a performance point of view

      :-)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 2690
        • 148 Posts
        thats interesting.
        2.0 instead of 2.1 ?


        Thanks!
          MODx Revo 2.0.6-pl (Traditional) | Apache 2.2.3 | PHP 5.2.14 | MySQL 5.0.77 | MAC OS 10.6.5 | FF 3.6/Chrome 9.0.5
          • 7231
          • 4,205 Posts
          No, I don;t think that is what heliotrope meant laugh The number of queries will depend on what you are using it for. For example if you are using a snippet within the ditto tpl and it iterated through 100 files it will run the embedded snippet 100 x and if that snippet has 3 queries (or uses an api function that uses a few queries) it will add on. Ditto itself needs to run a few queries just to put together the data as well as the document structure. It is easy in a large site to run several queries to build a simple list. This is one of the drawbacks in Ditto, it is a multi purpose tool so it has to be able to do a lot of stuff. In many cases it is recommended to use something simpler that is single purpose )or at least limited purpose).

          650 queries is a lot shocked
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don&#39;t know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 2690
            • 148 Posts
            nope no snippets in the template chunk...

            So what are you talking about than ? Version 2.0 ?


            Thanks
              MODx Revo 2.0.6-pl (Traditional) | Apache 2.2.3 | PHP 5.2.14 | MySQL 5.0.77 | MAC OS 10.6.5 | FF 3.6/Chrome 9.0.5