We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28673
    • 178 Posts
    @bertoost

    HI. I’m not an expert at all in modx, neither in php. Anyway, if you have to build a menu, is there a particular reason for not using Wayfinder?
      • 33968
      • 863 Posts
      Bleah!
      +1 to that laugh

      I guess you could temporarily remove the ’If’ and ’getImageWidth/Height’ snippets and hard code the image dimensions? See if that improves performance. At least then you can be sure that those snippets are not causing the problems.

      Your performance ’symptoms’ are very similar to those posted by someone a couple of weeks back - more details here. But beyond upgrading and clearing the cache I don’t think there’s much that could help you there. Let us know how you get on!
        • 3186 ☆ A M B ☆
        • 279 Posts
        Quote from: stratboy at Mar 29, 2011, 08:13 AM

        @bertoost

        HI. I’m not an expert at all in modx, neither in php. Anyway, if you have to build a menu, is there a particular reason for not using Wayfinder?

        Yes there is.
        In my case the menu contains main items, with subs of 2 types. One sub item must be shown left, others must be shown right (see www.keessmit.nl = modx revo 2.0.8-pl). This couldn’t be done with wayfinder and getresources is slower then my own simple snippet

        [edit]

        Almost on every topic, about speeding modx up, there they said that the configuration of the server is mostly the problem, but never a best configuration is given or some pitfalls mentoined. I’m running not an very old version of PHP and MySQL server, but I don’t know what the best config is so maybe someone who knows could contact me for further details?
          MODX Ambassador (NL) & Professional MODX developer
          Follow me on Twitter | Visit my page on Facebook | View my code on Github | View my script posts
          MODX e-commerce solution SimpleCart
          • 33968
          • 863 Posts
          @bertoost

          I see what you mean about the menu, I don’t really know how to achieve that with Wayfinder! Wouldn’t rule it out though smiley

          Have a look here and see how your setup compares: http://modx.com/revolution/developer/requirements/

          I’m not really sure how well your snippet is optimised. Perhaps you could limit it to only looping through the resources that you need, rather than everything on your site? You seem to have a lot of products on there, and if it’s going through all of them that could be slowing things down quite a bit.

          If you only need the categories for the menu perhaps you could include a WHERE clause in your query to include only the product category containers, and only go a certain level deep ... something like that? It seems to cache ok though, right?
            • 33968
            • 863 Posts
            Either of you get anywhere with this? There seem to have been a few similar issues come up lately, would be handy to know what the causes or solutions are...
              • 28673
              • 178 Posts
              Quote from: lucas at Apr 06, 2011, 11:03 AM

              Either of you get anywhere with this? There seem to have been a few similar issues come up lately, would be handy to know what the causes or solutions are...

              Hi, not for now. I think that probably I will write some custom snippet and see if it’s faster than getResources.

              Bye!

                • 3186 ☆ A M B ☆
                • 279 Posts
                Quote from: lucas at Mar 31, 2011, 12:46 PM

                @bertoost

                I see what you mean about the menu, I don’t really know how to achieve that with Wayfinder! Wouldn’t rule it out though smiley

                Have a look here and see how your setup compares: http://modx.com/revolution/developer/requirements/

                I’m not really sure how well your snippet is optimised. Perhaps you could limit it to only looping through the resources that you need, rather than everything on your site? You seem to have a lot of products on there, and if it’s going through all of them that could be slowing things down quite a bit.

                If you only need the categories for the menu perhaps you could include a WHERE clause in your query to include only the product category containers, and only go a certain level deep ... something like that? It seems to cache ok though, right?

                Thats why I did it with my own snippet. Because Wayfinder don’t support tvs

                My snippet is as small as you can see i the foreach. Only above that the pages are retrieved with a simple query. Only the nessecary levels are requested (first and second).
                  MODX Ambassador (NL) & Professional MODX developer
                  Follow me on Twitter | Visit my page on Facebook | View my code on Github | View my script posts
                  MODX e-commerce solution SimpleCart