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

    I have all pages in MODx cached and the global setting cacheable = 1.
    All pages have the ’Empty cache?’ tickbox checked...



    If a page is saved and the ’Empty cache?’ tickbox is checked, are all cached pages deleted in MODx 0.9.6.3 and MODx 1.0.2 ?

    Is there a way to only delete the cache file for that page only when the page is saved?

    Thanks smiley

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The problem is that if you make a change in one resource that will affect the menu structure, or some other output on other pages that depend on the content of the page being edited, then all the other pages would have the wrong information.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 18839
        • 39 Posts
        But if the Wayfinder, Ditto calls are uncached, then everything should be ok?
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: mb07 at May 15, 2010, 07:40 AM

          But if the Wayfinder, Ditto calls are uncached, then everything should be ok?
          Optimally, Wayfinder and Ditto calls should really never be left uncached IMO, unless a Wayfinder instance needs to change based on the User logging in. It’s certainly a lot more efficient to simply clear the caches on edit and and let them stay cached until the next edit.
            • 3496
            • 101 Posts
            Optimally, Wayfinder and Ditto calls should really never be left uncached IMO, unless a Wayfinder instance needs to change based on the User logging in.
            For my site I would indeed like to change the (wayfinder generated) meny based on the user logging in (one extra main-menu with several submenu’s), but the performance hit caused by the uncached use of wayfinder is too high.
            Is there an alternative?
              • 22303 MODX Staff
              • 10,725 Posts
              Quote from: Black at Jun 19, 2010, 08:36 AM

              Optimally, Wayfinder and Ditto calls should really never be left uncached IMO, unless a Wayfinder instance needs to change based on the User logging in.
              For my site I would indeed like to change the (wayfinder generated) meny based on the user logging in (one extra main-menu with several submenu’s), but the performance hit caused by the uncached use of wayfinder is too high.
              Is there an alternative?
              Not really. But Wayfinder should not be that inefficient for a simple menu. Ditto would typically be more of a problem uncached.
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                If you use an external config file for Wayfinder, you can use PHP code in the config file. You can have the pages you want hidden from general users to be set to not show in the menu, then in the config file have a conditional setting
                if($_SESSION['managerValidated']) $ignoreHidden = 1;
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 3749
                  • 24,544 Posts
                  I’ve used the Personalize snippet to deliver a different chunk to logged-in and not-logged-in users. Each chunk is cached and contains a cached Wayfinder tag. I don’t notice any performance hit when doing it this way.
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 3496
                    • 101 Posts
                    Thanks! I’ll try those things!