We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37234
    • 44 Posts
    Hello, I'm running MODX Revolution 2.1.3

    I've only set up a few MODX websites and the current project I am on, I had problems with MODX caching scripts as I was developing the site so I turned off some random script caching.

    The site is running great for me, but my client has reported the site is taking 10 seconds to load sometimes. Of course, there are things I can do to upgrade the server, but I wanted to start by asking what are the best settings now that the site is ready to launch.
      • 33968
      • 863 Posts
      You want to cache any snippets that output content that rarely changes:
      [[!snippet]]
      

      instead of
      [[snippet]]
      


      Wayfinder and getResources in particular seem to cause problems for some people if they are not cached/optimised correctly. Which snippets were you having caching issues with before?
        • 37234
        • 44 Posts
        it was really just database connections that were being cached.

        The client is complaining just regular pages are loading slow. I am using wayfinder and getResources on my site: www.hairlossmall.com. is it loading slow as you browse through pages?

        what can i do to optimize Wayfinder/getResources?
          • 38494
          • 13 Posts
          it's loading alright for me right now, 5secs max on some of the pages that have many getresources items i assume
            • 33968
            • 863 Posts
            Quote from: helpmejesus at Feb 28, 2012, 01:25 AM
            what can i do to optimize Wayfinder/getResources?
            For a start, make sure these snippets are cached...
              • 37234
              • 44 Posts
              For good measure, Can you copy this code and do a quick find for "[[" and make sure I'm ! caching all my tags properly

              [[!php-includes]]<!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>
              <title>[[++site_name]] - [[*pagetitle]]</title>
              <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
              <base href="[[++site_url]]" />
              <link href="style.css" rel="stylesheet" type="text/css" />
              <script type="text/javascript" src="js/jquery.js"></script>
              <script type="text/javascript" src="js/jquery.gSearch-1.0-min.js"></script>
              <script type="text/javascript" src="include/drop-list/jquery.dropList.js"></script>
              <link href="include/drop-list/drop-list.css" rel="stylesheet" type="text/css" />
              
              <script type="text/javascript">
              $(document).ready(function(){
              
              	$("#envatoLinks").dropList({
              		style: "blue",
              		width: 220,
              		target: "self",
              		speed: 500,
              	});
              	
              	
              	$(".color").click(function(e){
              		e.preventDefault();
              		var color = $(this).attr("id");
              		$("div").eq(1).removeClass();
              		$("div").eq(1).addClass("dropList-layout").addClass(color);
              	});
              	
              	
              });
              </script>
              </head>
              <body>
              <div class="main">
                <div class="header">
                  <div class="block_header">
              
                    <div class="logo"><a href="[[++site_url]]"><img src="images/logo.gif" border="0" alt="logo" /></a></div>
                    <div class="search">
              
              
              
              
                      <form id="form1" name="form1" method="get" action="search.html">
                        <label><span>
                          <input name="Q" type="text" class="keywords" id="textfield" maxlength="50" value="" />
                          </span>
                          <input name="b" type="image" src="images/search.gif" class="button" />
                        </label>
              
                      </form>
              
                    </div>
                    <div class="menu">
                       [[!Wayfinder? &startId=`0`&rowTpl=`wrapspan`&innerClass=`active`]] 
                    </div>
                    <div class="clr"></div>
                  </div>
                </div>
                <div class="slider_top">
                  <div class="header_text2">
              
                    <div style="float: right; width 200px; ">
                       <div style="float: right; width: 250px; padding: 0 8px 10px 0;font-size: 18px; font-weight: bolder; color: #666; text-align: right;"> 
              NEXT EVENT: [[!nextEvent]] Days  
              <br/><a href="schedule-a-consultation.html?id=[[!next-event-id]]"><img src="images/Sing_up.gif" alt="picture" border="0" /></a>
              </div> 
              
                    </div>
              
                    <h2>[[!getResourceField:ifempty=`[[*pagetitle]]` ? &id=`[[*parent]]` &field=`pagetitle`]]
              
              
              
              </h2>
                    <div class="clr"></div>
                  </div>
                </div>
                <div class="top_bg2">
                 <div class="clr"></div>
                </div>
              
                <div class="clr"></div>
              
                 <div class="body">
                  <div class="body_resize">
                    <div class="left">
                      [[!Breadcrumbs?!]] <p>
                      [[*content]]
                    </div>
                    <div class="right">
              
              
              
              
              [[!Wayfinder?&startId=`[[*parent:ne=`0`:then=`[[*parent]]`:else=`[[*id]]`]]`&level=`0`&outerTpl=`rightnavOuter`&parentRowTpl=`rightnavParent`&innerTpl=`rightnavInner`]]  
              
              <div class="clr"></div>
                    </div>
                    <div class="clr"></div>
                  </div>
                  <div class="clr"></div>
                </div>
                <div class="footer">
                <div class="footer_resize">
                <p class="leftt"><table width="960" border="0" align="center">
                <tr>
                  <td width="474" align="left" valign="top"><table width="149" border="0" cellpadding="5">
                    <tr>
                      <td><a href="http://www.facebook.com/BaldingBlog" target="_blank"><img src="http://scalpmicropigment.com/images/facebook.png" width="45" height="44" border="0" /></a></td>
                      <td><a href="http://twitter.com/#!/baldingblog" target="_blank"><img src="http://scalpmicropigment.com/images/twitter.png" width="45" height="44" border="0" /></a></td>
                      <td><a href="callto://scalpmicropigment/" target="_blank"><img src="http://scalpmicropigment.com/images/skype.png" width="45" height="44" border="0" /></a></td>
                    </tr>
                  </table>
                    <table width="200" border="0" cellpadding="5">
                      <tr>
                        <td><a href="http://www.baldingblog.com/" target="_blank"><img src="http://scalpmicropigment.com/images/blog.png" width="130" height="35" border="0" /></a></td>
                        <td><a href="http://www.baldingforum.com/" target="_blank"><img src="http://scalpmicropigment.com/images/forum.png" width="130" height="35" border="0" /></a></td>
                      </tr>
                    </table></td>
                  <td width="476" align="right" valign="top"><div style="margin-top: 20px;"><object width="230" height="85" data="https://clients4.google.com/voice/embed/webCallButton" type="application/x-shockwave-flash"><param name="movie" value="https://clients4.google.com/voice/embed/webCallButton" /><param name="wmode" value="transparent" /><param name="FlashVars" value="id=bad58be13f4c8baba5a438cdd2bd10e6be1c7bb8&style=0" /></object></div>
              </td>
                </tr>
              </table>
              © Copyright 2012. New Hair Institute. All Rights Reserved<br />
              
                  <a href="#">Home</a> | <a href="#">Contact</a> | <a href="#">RSS </a></p>
                  <p class="rightt"><a href="#"><strong> </strong></a></p>
                  <div class="clr"></div>
                <div class="clr"></div>
              
              </div>
              
              </div>
              </div>
              
              
              </body>
              </html>
              
                • 33968
                • 863 Posts
                No need to copy, I can see right away that all your snippets are uncached (with the "!").

                Set them all like this:
                [[Wayfinder...]]
                

                I realise the way I wrote my post above seems to be suggesting the opposite, I wasn't very clear. Sorry about that smiley
                  • 37234
                  • 44 Posts
                  ok thanks for re-clairifying, that is how I originally had my wayfinder and resource calls.

                  is there anything else i can do that comes to mind?

                  thanks for your time smiley