We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    I suspect that phpthumbof is taking much of the time, since (AFAIK) it creates every thumbnail on the fly each time the page is viewed. I don't do a lot of image processing in Revo, so I'm not sure what the best alternative would be.

      Did I help you? Buy me a beer
      Get my Book: MODX:The Official Guide
      MODX info for everyone: http://bobsguides.com/modx.html
      My MODX Extras
      Bob's Guides is now hosted at A2 MODX Hosting
    • To Bob's comment - phpthumbof only regenerates thumbnail images if the cached images have been cleared. So if you disable the cache clearing plugin, it doesn't have to regenerate them every time the cache is cleared. ad2003, did disabling the phpThumbOfCacheManager plugin change the load time at all?

      Regarding multiple getResources calls, I'm not sure how you would go about combining them. I suppose you could use one call, output all of the fields into clearly identified html elements and then use JavaScript to move the text around on the page to where you need it, but that's pretty clunky.

      I think the best thing to do would be to use MIGX to store your resources as a set of MIGX grid items, and not use resources for the various page elements at all. If I understood correctly, these resources don't actually have their own page, correct? They are just displayed on the one main page. So the resources don't really need to exist as resources. You just need a way to get the same text and images on the main page in a systematic manner. So set up a MIGX TV with fields corresponding to myImg, longtitle, content etc, and put the data from the resources in the MIGX TV as grid items. Then you would use the MIGX snippet getImageList instead of getResources to create your various lists. I bet that would be much faster, and it's more elegant too since resources are really meant to represent pages, not pieces of another page.

      However, if you can't do that I would optimize each of your getResources calls as best you can (remove nested chunks, turn off processTVs, limit to only the one TV you need, simplify the template chunks as much as you can). I think that will give you performance about as good as it's going to get with this setup.
        • 42101
        • 125 Posts
        Hi!

        Thanks for your replies!

        I checked the page with phpthumbof plugin turned off, on - almost same speed. Also getCache is not making a big deal in time saving for now.
        It takes about 10-12secs for the first time. But when the page is cached once, I get 93 points a google page insights and as I have a pageLoad timer for FireFox, I can see, the page loads in under 2secs completely.

        The first time I started working on that page, I was using migx for the pages - but I found the handling with the resource tree, easier for changing and stuff...It was my first "online" webpage with modx - so I just didn't really know how to insert stuff the best way. Migx is great and I get used to it more and more thanks to guys like you helping me out with noob problemss/questions.

        I am going to try to reduce some chunk stuff and getResources calls. Maybe that will help. But for now I am satisfied, that the page is working so far.

        As you kindly put a code in that post for cleaning only the "navigation cache" as action, wouldn't it be possible to create a button to just "cache the page"?

        Thanks so far!!

        AD
          • 3749
          • 24,544 Posts
          Two more things to check out:

          A replacement for PhpThumbOf: http://modx.com/extras/package/phpthumbsup

          A way to not clear the whole site cache when you edit a page: http://bobsguides.com/cachemaster-tutorial.html
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
          • Wow, thanks Bob, I hadn't seen phpThumbsUp before. It's awesome, major kudos to Darkstar for that!
              • 3749
              • 24,544 Posts
              I haven't tried it, but it looks great.

                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 42101
                • 125 Posts
                I will give it a try soon! thanks!

                AD
                • I tried it, and found that in most situations I prefer it to phpthumbof. Basically the difference is that even if generating the images is slow, the page will go ahead and load first, and then load in the images as they are created. That's far preferable to just looking at a blank screen while it processes your images.

                  The only exception is in one case where I'm loading some image-rich content with AJAX, and the formatting gets messed up because the HTML content loads in before the images exist. In that case, I prefer to wait until the images are generated before the content is loaded.
                    • 42101
                    • 125 Posts
                    I Installed it, but I am just getting a "/phpthumbsup/w/120/h/120/zc/1/q/100/src/mydirecory/myfiles.png" as src. But when I check the ftp folders, I can't find the folders, the url is linking to.

                    in phpthumbsup.base_url is set to "phpthumbsup/".

                    AD
                    • No, you won't find those folders, it's a virtual directory structure. They're URL parameters. What should happen is that when you request that URL, it serves the appropriately sized image. If it's not doing that, I'm not sure why.