We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2602
    • 24 Posts
    How does the cache work exactly in modx? Is there a way to increase the amount of time a page is handled from cache and not be re-rendered? thanks.
      • 25663 MODX Staff
      • 12,272 Posts
      Cache only regenerates when changes are made to the page.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 2602
        • 24 Posts
        is there any known way I can make the cache clear and reload a page after a specified time interval? Like clear cache every 10 minutes or something?
          • 2602
          • 24 Posts
          well, i figured out how to clear cache programmatically. Havent tested it yet though....

          include_once $modx->config['base_path']."manager/processors/cache_sync.class.processor.php";
          				$sync = new synccache();
          				$sync->setCachepath("assets/cache/");
          				$sync->setReport(false);
          				$sync->emptyCache();
          



          Does anyone know if there is a timestamp associated with the last cached version of the page/site? I want to get that time and compare with current time and then clear cache if neccisary.
            • 25663 MODX Staff
            • 12,272 Posts
            Out of curiosity, why do you want to periodically clear the cache? You can disable caching for snippets on a cached page by calling like [! ... !] giving you partial page caching.
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me