We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1343 ☆ A M B ☆
    • 2,213 Posts
    Hello,

    Did you check out these extras?

    Primes Cache - http://modx.com/extras/package/refreshcache
    Selective Cache Clearing - http://modx.com/extras/package/uncacher
      Patrick | Server Wrangler
      About Me: Website | Tweets |  MODX Hosting
      • 36624
      • 535 Posts
      Quote from: AMDbuilder at Oct 31, 2012, 09:09 PM
      Hello,

      Did you check out these extras?

      Primes Cache - http://modx.com/extras/package/refreshcache
      Selective Cache Clearing - http://modx.com/extras/package/uncacher

      Thanx for the directions. I didn't know these Extras. I'm currently testing them but i had problems with the first (didn't fire) and the second is slowing the save process on every resources which is another problem..

      Meanwhile, my friend @ackwa has found a nice workaround. He made an extension for Batcher Component ( you can find it here: https://gist.github.com/4001336) which had a new option "refresh cache" to the main menu. (when you install you need to clear all cache, close your browser to appear etc..) So you can benefit the Batcher parameters like selecting by template.. and rebuild the cache only for the selected resources. I think it's a very elegant way because it's in the UI.

      It's not heavly tested but on slow server or on very heavy pages you can have timeout..

      Actually, if you want to see the request, you need to open the console under the "Network" tab.

        CTRL+SHIFT+U - Clear Cache
        CTRL+SHIFT+H - Hiding Heft Panel
        CTRL+SHIFT+N - Fast Create Resource
        CTRL+ALT+P - Preview Recource (in edit resorce window)
        CTRL+ALT+S - Save
        • 36624
        • 535 Posts
        Another incredible optimisation trix to gain speed on first cache is to check if you have conditions with chunks or snippets :
        for example replace :
        [[If?
        				&subject=`[[*id]]`
        				&operator=`is`
        				&operand=`19`
        				&then=`[[$myCHUNK]]`
        	]]

        with :
        [[[[*id:is=`19`:then=`$myCHUNK`]]]]
          CTRL+SHIFT+U - Clear Cache
          CTRL+SHIFT+H - Hiding Heft Panel
          CTRL+SHIFT+N - Fast Create Resource
          CTRL+ALT+P - Preview Recource (in edit resorce window)
          CTRL+ALT+S - Save
          • 14677
          • 54 Posts
          Quote from: emmanuel at Nov 13, 2012, 07:07 AM
          Another incredible optimisation trix to gain speed on first cache is to check if you have conditions with chunks or snippets :
          for example replace :
          [[If?
          				&subject=`[[*id]]`
          				&operator=`is`
          				&operand=`19`
          				&then=`[[$myCHUNK]]`
          	]]

          with :
          [[[[*id:is=`19`:then=`$myCHUNK`]]]]

          I've actually found that by using Output modifiers as above it slows it down more than if you use the IF snippet.. Again I guess this would totally depend on how many IF snippet and output modifiers were called.
            • 18373 ☆ A M B ☆
            • 3,141 Posts
            Quote from: jonrawlins at Nov 13, 2012, 08:58 AM
            Quote from: emmanuel at Nov 13, 2012, 07:07 AM
            Another incredible optimisation trix to gain speed on first cache is to check if you have conditions with chunks or snippets :
            for example replace :
            [[If?
            				&subject=`[[*id]]`
            				&operator=`is`
            				&operand=`19`
            				&then=`[[$myCHUNK]]`
            	]]

            with :
            [[[[*id:is=`19`:then=`$myCHUNK`]]]]

            I've actually found that by using Output modifiers as above it slows it down more than if you use the IF snippet.. Again I guess this would totally depend on how many IF snippet and output modifiers were called.

            The point in that example from emmanuel is that the chunk is only executed when it SHOULD be be executed. When calling it in the if syntax where the full tag is inside the "then" condition, it will parse inside out. So first [[$myCHUNK]] (which may contain three wayfinder menus that get executed), and only after that it will check if it needs to.

            Using the trick emmanuel posted, the parser doesn't see the chunk unless it has to actually parse it.
              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.
              • 14677
              • 54 Posts
              Gotcha... I can see the point there now.

              Thanks for the clarification Mark smiley