⚠️ Urgent! Active Attacks on MODX Revolution Sites Below Revolution 2.6.5
Subscribe: RSS
  • I’m using wayfinder to load a menu that is 4 levels deep and has about 750-1000 items in it. Here is the snippet call:

    [[Wayfinder?startId=`0`&level=4]]

    This call takes about 10 seconds to process every single page load. I was under the impression that since I’m calling this snippet cached that it would just grab it out of the cache after processing it once.

    Anyway, it’s terribly slow and I’d appreciate any advice on how to make this faster. Is this amount of data just to much for Wayfinder/MODx to handle?

    I’m running this site on an OS X server (1.4), Apache 1.3, PHP 5.1.2

    Thanks,

    James


    • Is this on a public server that we could see a link?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
      • If the document is cached and the snippet call is cached, then the whole page will be cached, menu and all.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
        • The reason I ask if there’s a public link because I wanted to see if there’s any other elements that might not be loading. I’ve seen missing favicons or JS files cause a similar behavior. And depending on what’s going on with your Wayfinder template it may be something missing that’s causing a similar behavior.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • Sure, here is the link to my test case. The only difference between these two pages is that the snippet code mentioned in my first post has been removed in the testindex page

            Slow page with the Wayfinder code (takes about 25-30 seconds to load)
            http://www.gips.org/dev

            Fast page without Wayfinder code (takes about 3 seconds to load)
            http://www.gips.org/dev/testindex

            Let me know if you find anything out or need more information from me. Thanks for looking into this!!!

            Ok, and I figured out one more thing. The this page was set to NOT be cached because it uses the Maxi gallery snippet (I forgot that I did that). When I set the page to cache, the first time it takes forever to load, but subsequent times it is much faster (about 3 seconds or less). So, does anyone know any workarounds for that?? Note that Cacheable is set to NO on the examples above to show the speed difference.

            James
            • There’s something strange in line 129-131:

              <?
              // Use the following syntax $param = 'value';
              ?><li style="margin-top:10px">
              


              Why can I view PHP via "view source" in my browser? Find out where this is coming from and delete it from that snippet/chunk or whatever it is. Maybe it’s confusing the parser...

              Then, you might also check if maybe the accuweather stuff is maybe slowing things down. And the usual routine checks: Are all CSS and JS files on the server? Are their paths correct? etc.
              • Actually, I just noticed one more strange thing: The extremely slow-loading page sends UTF-8 server headers, but you declare ISO-8859-1 via HTML-tags.

                And in all cases, it never hurts to check your HTML + CSS.
                The W3C validator reports 187 HTML-errors and 14 CSS errors.

                http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.gips.org%2Fdev%2F
                http://jigsaw.w3.org/css-validator/validator?profile=css21&warning=0&uri=http%3A%2F%2Fwww.gips.org%2Fdev%2F

                • As far as UTF-8 vs ISO-8859-1, MODx sets that via PHP and it overrides the meta tag (at least it does in firefox) The Setting is in the Manager Configuration. You probably know this already, but it took me a while to figure out and should be corrected. Thanks for pointing that out and for finding the php output stuff. I’ll look into that.

                  James
                  • You can also use MODx timing tags for more timing information as well. It might help.
                      Zaigham R - MODX Professional | Skype | Email | Twitter

                      Digging the interwebs for #MODX gems and bringing it to you. modx.link
                    • Ok, I think I need to reformulate my question. I know that the issue lies with the giant menu. When it loads the first time the page takes about 30 seconds to load. The snippet does get cached so subsequent calls to that page take only about 3 seconds for me. I think I confused myself on this issue because the page in the example was set to be uncached since it uses MaxiGallery.

                      So, I don’t know why Wayfinder takes such a long time to process this amount of pages. If I take the level parameter down to 2, it takes much less time, so I’m beginning to think that I’ve started to stretch the limits of wayfinder with this amount of pages. Anyone have ideas on how to make this faster for every page on the first load? Since the large main menu is the same everywhere I wonder if I could use wayfinder to write a file, and include that file instead of the snippet code.

                      Has anyone done anything like that before, or have a better idea??

                      Thanks,

                      James