define('MODX_API_MODE', true);
require_once('/home/website/public_html/index.php');
$modx = new modX();
$modx->initialize('mgr');
$doc = $modx->getObject('modResource',$_POST["resource_id"]);
$doc->setContent($_POST["content"]);
$doc->save();
the front end pages are not reflecting the changes. I have confirmed on the back end that the resources have indeed been updated. I can force the changes to be visible on the front end only by either clearing the cache, or saving the resource on the back-end - effectively clearing the cache for that resource I believe.This question has been answered by BobRay. See the first response.
@unlink(MODX_CORE_PATH . 'cache/resource/web/resources/' . $resource->get('id') . '.cache.php');$modx->cacheManager->refresh();