According to the MODx wiki, you can call:
However, looking at what that code actually
does, it’s no different than the ClearCache script -- it removes all of the *.pageCache.php files in assets/cache/ without rebuilding siteCache.idx.php
So, in order to clear the cache, do what the manager does:
function clearCache() {
include_once "manager/processors/cache_sync.class.processor.php";
$sync = new synccache();
$sync->setCachepath("assets/cache/");
$sync->setReport(true);
$sync->emptyCache();
}
This thing works like a charm; I had all kinds of trouble with programmatically-created blog posts not getting picked up by Ditto, and using this function after creating each post did the trick.
I used that function in a snippet; adjust the paths to use elsewhere.
Seems like a MODx bug, no?