We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43667
    • 1 Posts
    Hi there-

    Is a complete novice speaking here as My website designer is not available fix this website speed issue in the near future- so im trying to have a go :-/. The website is too slow loading- makes it looked like the internet has crashed-
    Have sought advice from a programmer relative but they are not sure about how MODX works- he mentioned I might need to make the images even smaller (55kb) or get some kind of plug in such as- SmartOptimizer 1.0.0-pl- i dont know what a plug-in is yet so wondering if anyone has experience with this and knows which option would be best before i learn?

    Any advice would be great! smiley
      • 4172
      • 5,888 Posts
      seems not to be the images.
      How do you generate the image-lists?

      to see some snippet-codes and tpl-chunks, perhaps the template-code could be helpfull.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 43669
        • 5 Posts
        i check the site and the load of images is very fast
        are you sure that not just your connexion speed ?
          • 38290
          • 712 Posts
          If you are on a Mac ImageOptim is a great free lossless image compression tool
            jpdevries
            • 38290
            • 712 Posts
            Does take some time to generate markup for the projects landing page for example. Could we see the Template and related Chunks/Snippets being used?
              jpdevries
              • 9102 ☆ A M B ☆
              • 318 Posts
              The images sizes are fine. They're being generated with phpthumbof which does a good job of compressing the images. That is not the problem. The problem is the time it's taking to generate the pages in the first place. This is probably a problem with the details of the way MODX is configured.

              It's hard to say from the outside, but it feels to me like your getResources call (or whatever is generating the image lists) is not being cached.

              Two things to check:

              Make sure that the pages themselves are allowed to be cached. Click on one of the pages in the manager and go to the "settings" tab, and make sure "cacheable" is checked. If it's not, go through all of your pages, check "cacheable" and save the page.

              If the pages are cacheable, then you are probably calling getResources uncached. To fix that, you will have to go into the template for these pages. Somewhere in the template, or in one of the chunks contained in the template, will probably be code that looks like this:
              <div id="wrap2" class="collection topsp15">
                              	
              <ul>[[!getResources? ....
              


              Just remove the "!" from the beginning of the getResources call, so that it reads:

              <div id="wrap2" class="collection topsp15">
                              	
              <ul>[[getResources? ....
              


              This will call getResources cached, which means that only the first pageview after clearing the cache will be slow, and after that it should be very fast.

              If that doesn't work, or if you can't find the code, let us know and we can probably help you find the problem.

              If this works out for you and you want to get into optimizing the speed even for the first pageload, we can talk about how to use getCache to partition your caching scheme - but that's probably more advanced than you need to get right now. Let's start with getting it so that it performs fast cached, then we'll worry about uncached speed.
                • 9102 ☆ A M B ☆
                • 318 Posts
                OK, I realized that in my last post I didn't explain how to look in the template - you said you're a complete novice, so you might not know. To edit your template code:

                • Go to one of the pages in the manager, for example the projects page
                • Look in the upper right corner where it says "uses template" and note which template the page is using
                • Go to the "elements" tab on the left (if you can see it. If not, you don't have permissions to fix this problem and will have to consult your designer.)
                • Open up the "templates" section (by clicking on the triangle), and look for the template you noted earlier. It may be in a category folder inside the templates section.
                • Click on the template to edit it. If you find the code I posted above, modify it as I suggested. If not, post the code from the template here and we can use that to figure out what to do next.
                  • 43854
                  • 5 Posts
                  Hi freejung

                  tourdeforce has asked me to take a look at her website and passed on this post.

                  Your advice is excellent and I've managed to sort the caching issue after first page load.

                  You mentioned removing the '!' from getResources?

                  I couldn't find this in the templates but instead applied the same technique to !getImageList?

                  Unfortunately, the initial pageload is still around 7 seceonds so would really appreciate any advice you have regarding the getcache plugin you mentioned and how to have this speed up the initial page load?

                  I've already downloaded and installed the plugin so any advice now would be really appreciated.

                  Thanks in advance smiley
                    • 38290
                    • 712 Posts
                    It would be great if you could show us some of the templates by pasting them in here as code or using something like gist.github.com
                      jpdevries
                      • 43854
                      • 5 Posts
                      Hi JP

                      Sure, here's the collection template:

                      
                      [[$header]]
                      
                      <body>
                      <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td class="logo_ext"> </td>
                          <td width="760">
                          
                      		<div id="wrap">
                              	<div id="wrap3" class="header">
                                      <div id="header_left"><img src="assets/images/system/logo_b06.gif" /></div>
                                      <div id="header_right"><a href="[[~1]]"><img src="assets/images/system/logo02.gif" name="Logo right" width="236" height="16" border="0" id="Logo right" /></a></div>
                                  </div>
                      			<div id="wrap">
                      				<div id="navbar">
                      					[[$nav]]
                      					<span></span>
                      				</div>
                      				<div id="wrap2">
                      				  <div id="subnav"><strong>—</strong>
                                          <br />[[Wayfinder? &startId=`[[*parent]]` &level=`1`]]</div>
                      				</div>
                                      <div id="wrap2" class="collection topsp15">
                                      	
                      <ul>[[getImageList? &tvname=`gallery-images` &tpl=`gallery-image`]]</ul>
                                      </div>
                      			</div>
                              	[[$footer]]
                          		</div>
                          </td>
                          <td> </td>
                        </tr>
                      </table>
                      </body>
                      </html>