We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    That’s right, clearCache only removes documents that are cached and does not affect the siteCache. This is what the synccache Class is for.
      • 17544
      • 86 Posts
      Quote from: OpenGeek at Dec 05, 2006, 01:47 PM

      That’s right, clearCache only removes documents that are cached and does not affect the siteCache. This is what the synccache Class is for.

      In the clear_cache() function that I use

      function clear_cache()
      {
      	global $modx;
      	include_once($modx->config('base_url') . "manager/processors/cache_sync.class.processor.php");
      	$sync = new synccache();
      	$sync->setCachepath($modx->config('base_url') . "assets/cache/");
      	$sync->setReport(false);
      	$sync->emptyCache();
      	$modx->clearCache(); // double clear cache
      }
      


      synccache() is used. That’s why I can’t figure out what else can go wrong.
        • 22303 MODX Staff
        • 10,725 Posts
        Doh!

        $modx->config('base_url')


        is not correct...config is an array, not a function, so it should be...

        $modx->config['base_url']
          • 17544
          • 86 Posts
          Oh My God! shocked

          I need to kill myself for this!

          Thanks OpenGeek! I don’t think I can find this careless mistake at all as I am looking at the wrong direction!