We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38290
    • 712 Posts
    That template seems ok so if its the template used on the slow page, must be something in one of the chunks it calls that slows it down. (Like $nav or $header)
      jpdevries
      • 43854
      • 5 Posts
      Do you think?

      Does anything look awry in this code?

      Nav:

      <ul>[[Wayfinder? &startId=`0` &excludeDocs=`1,4` &level=`1` &limit=`0` &outerTpl=`nav-tpl` &rowTpl=`nav-row-tpl`]]</ul>


      Nav row:

      <li><a href="[[+wf.link]]">[[+wf.linktext]]</a></li>



      Header:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <title>[[++site_name]] // [[*pagetitle]]</title>
      <base href="[[++site_url]]" />
      <link href="assets/css/ltdf.css" rel="stylesheet" type="text/css" />
      <link rel="stylesheet" type="text/css" href="assets/css/jquery.lightbox-5.css" />
      <link rel="shortcut icon" href="assets/images/system/favicon.ico" />
      <link rel="icon" href="assets/images/system/favicon.ico" />
      </head>


      Gallery images:

      <li>
          <a class="lighbox" title="[[+caption]]" href="[[+image:phpthumbof=`&wl=930&wp=450`]]">
              <img src="[[+image:phpthumbof=`w=180&h=250&zc=1`]]">
          </a>
      </li>


      Footer:

      <div id="wrap3" class="footer">
                  	<div class="footer_top">
                          <div id="footer_left">
                              <ul>
                                  <li><a href="[[~7]]">contact</a></li>
                                  <!--<li><a href="">blog</a></li>//-->
                                  <li><a href="http://twitter.com/#!/_TOUR_DE_FORCE" target="_blank">twitter</a></li>
                              </ul>
                          </div>
                          <div id="footer_right"><a href="http://www.myfriendqp.com" target="_blank">designed by myfriendqp.com</a></div>
                      </div>
                  </div>
      <script type="text/javascript" src="assets/js/jquery-1.6.2.js"></script>
      <script type="text/javascript" src="assets/js/ltdf.js"></script>
      <script type="text/javascript" src="assets/js/jquery.cycle.all.js"></script>
      <script type="text/javascript">
      $(document).ready(function() {
          $('.slideshow').cycle({
      		fx: 'fade',
      		speed: 5000,
      	});
      });
      </script>
      <script type="text/javascript" src="assets/js/jquery.lightbox-0.5.js"></script>
      <script type="text/javascript">
      $(function() {
      	$('a.lighbox').lightBox(); // Select all links with lightbox class
      });
      </script>
      • the initial pageload is still around 7 seceonds
        By "initial pageload" you mean the first pageload after clearing the cache? Because the cached speed looks fine to me now. Removing the ! from getImageList means that the getImageList snippet is now being called cached, which is what you want.

        I don't see anything wrong with your code. I think phpthumbof is making it slow uncached. Disable the plugin "phpThumbOfCacheManager" or switch to using phpThumbsUp.

        If you do that and it's still slow, use getCache to separate out your cache partitions, see this blog post: http://modx.com/blog/2012/10/29/optimization-with-getcache-and-custom-cache-partitions/
          • 43854
          • 5 Posts
          Thanks for the info.

          Yes, it's the initial page load that's the killer now. I tried disabling the plugin but to no avail.

          I'm not sure why it it won't load like a normal HTML site, it's as if it is trying to call something that isn't there and getting tripped up for a while. I looked at the getCache plugin but to honest found it all quite confusing.
          • That's odd, disabling that plugin should have sped it up quite a bit.

            Here's what's happening: with the phpThumbOfCacheManager plugin enabled, every time you clear the cache, the plugin clears out the phpthumbof cache. That means that all of the image thumbnails have to be re-created. Image processing puts a lot of load on the server. It's normal for that to take a while. It can't load like a normal HTML site (uncached) because it's actually creating the images on the fly.

            If you disable the plugin, the cached thumbnail images should not be cleared out when the cache is cleared. That means that the thumbnails don't have to be re-generated, and it should run much faster. All it has to do is figure out that it already has the thumbnail cached - normally that's a fairly trivial operation.

            Try this - with the plugin disabled, visit every page of the site. Then clear the cache. Then visit each page again. I bet it's a lot faster.

            I wouldn't worry too much about getCache, as I don't think it will help much in this situation anyway. You could use it to put the Wayfinder and getImageList calls into different cache partitions, so that the cache for those calls is only cleared when you want to clear it, but the site is small enough that shouldn't matter much.
              • 43854
              • 5 Posts
              Hi Freejung

              Just to say that I think you've hit the nail on the head, just doing a little more testing but everything seems to be working well now so thank you so much for your help, I really appreciate it.

              Hopefully I won't bother you again!

              Paul
              • ;-) no worries, bother me any time.