We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18373 ☆ A M B ☆
    • 3,141 Posts
    Isn't it that this will not been updated when i call it cached?
    Why not make sure your truncating routine clears the cache? That way you still serve 99% of your requests cached and benefit from both speed and less drain of your servers' performance in general.

    But it still needs around 9 seconds to render the page and put it to the cache. I thing thats still a lot.

    It is a lot. What kind of times are you seeing when loading from cache? Also, are those times the complete loading times (including images and javascript processing), or the actual wait / generation time before the browser receives the data?

    There have been some improvements in the past few weeks which will bring a number of performance improvements to 2.2.2, and the team is actively working on improving speed where they can.
      Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

      Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
      • 38136
      • 42 Posts
      Well, i still do not understand the caching of MODx so much. What happens when i have a snippet call which is shown in the header or sidebars in the template at every resource? In my case it might be an event promotion for the next coming event. Is the resource cached completely or just cached partly? Guess the php caching make the caching a bit more smart then just simple file caching.

      Well the times i am talking about are absolutely subjective. I messure them with an alarm clock in front of my screen. So far i don't know whethere there are debuging opions to show the render time in MODx. Well, i thought about to put some code to the index php. But for that i still have to less knowledge about the MODx core structure.

      I rolled out a beta of the project now. The load is still high. But it seems to be buffered by the cache properly. When i called the resource then the first time it needs a long time to render. But it seems much more faster the second and third load. I also tested with diffent browsers and even environment.

      So i believe the hight load also might be caused by my online developement, of course.
        • 18373 ☆ A M B ☆
        • 3,141 Posts
        MODX does partial page caching, and it is quite granular in how it does that.

        Basically it starts by fetching the template. It parses all the cached tags that it finds and repeats that recursively and in source order until there are no more cached tags left in the source. When it's done doing that, it will take the output it has at that point (which includes uncached tags), and writes all that to the file cache. Then it starts parsing uncached tags, and when it done all that it returns the final output to the browser.

        The next, cached, call starts by getting the file cache, then parsing uncached tags, and finally returning the output to the browser.

        Of course there's more to it than just this, but it's a high level overview to get you going. I've written two articles on my blog about caching which may be interesting to read as they provide you with some more insights. http://www.markhamstra.com/modx-blog/category/Caching/

        As for measuring the time, I tend to use Firebug (a firefox addon) or the Chrome Dev tools to get an idea of that. http://markh.nl/s/04/Nkt.png - the "wachten" (Dutch for "waiting") time is the time spent by PHP (or MODX) parsing the request into a page, in this case is 178ms.
          Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

          Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
          • 11055 ☆ A M B ☆
          • 3,112 Posts
          In this part
          [[*content:notband=`[[*id]]`:notempty=`
              <div id="wrapper_content">
                  <div id="content" class="padit">
                      [[*content]]
                  </div>
              </div>
          `]]
          


          Try to replace it with chunk:
          [[*content:notband=`[[*id]]`:notempty=`[[$content-chunk]]`]]
          

          content-chunk :
              <div id="wrapper_content">
                  <div id="content" class="padit">
                      [[*content]]
                  </div>
              </div>
          

          the chunk will be cached.

          Output Modifier is a beast.
          But don't feed it with too much contents.
          It does the preg_match_all recursively.
          It will walk too slow.
            Rico
            Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
            MODx is great, but knowing how to use it well makes it perfect!

            www.virtudraft.com

            Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

            Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

            Maintainter/contributor of Babel

            Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
            • 22303 MODX Staff
            • 10,725 Posts
            The problem with any of these conditional-logic approaches in the presentation layer is that ALL the tags will be processed, regardless of which condition is met. This is why I generally use simple snippets (including as custom output modifiers) to make decisions on conditional parameters; it will simply be more efficient.
              • 38136
              • 42 Posts
              I was able to put the render time down by some caching and the here mentioned improvements. http://files.mopox.de/speed.jpg its about 6s now. And the caching seems to work well. After i called it once, i am getting normal loading times after it is cached. But depending from the content it loads still between 4 two 6s.

              Actually we can live with that so far.
              Thank u for all ur help.
              I appreciate this a lot.
                • 22303 MODX Staff
                • 10,725 Posts
                If you have small amounts of traffic or do not change the site often, that might be ok, but IMO, a page should never take more than 1s to load from the server. It's a good target to shoot for, unless you have specific scalability needs that might require even further optimization...
                  • 38136
                  • 42 Posts
                  Well, the cached state of a resources is under 1 second. Just uncached it needs a good amount of load. So we can live with that.