Depending on the size of your site and the number of cached pages, there could be quite a bit of overhead in using this function, so be very selective in its use. Although the function says that it rebuilds the site cache, it does rebuild the site settings, aliases, document content types, templates, chunks, snippets but not individual pages. Individual page cache files are rebuilt when they are visited for the first time after a cache clear.
This function also listens for sheduled publishing and unpublishing to keep the cache in sync.
function syncsite() {
// clears and rebuilds the site cache
// added in 0.6.1.1
// Modified 2008-03-17 by Ralph for improved cachePath handling
include_once("./manager/processors/cache_sync.class.processor.php");
$sync = new synccache();
$sync->setCachepath("assets/cache/");
$sync->setReport(false);
$sync->emptyCache();
}An example of use:
$formData=$_POST['form']; $formData=sanitiseData($formData);//a fictitional magic function :) $etomite->putIntTableRows($formData,'etomite_site_content'); $etomite->syncsite(); return "Data saved, page cache has been refreshed.";

Sign In
Register
Help

MultiQuote