Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

Run Cache Flush Command (for Varnish) on Publish


Go to End
Reply


9 Posts   1067 Views

Avatar
Bam

Community Member, 16 Posts

16 September 2013 at 3:40pm

Brilliant, that did the trick:

public function onAfterWrite() {
if($this->ParentID) {
$top = $this->getAncestors()->First();
} else {
$top = $this;
}
$cmd = escapeshellarg('ban.url ' . $top->Link());
system('varnishadm -T :6082 ' . $cmd);
return true;
}

Thanks again!

Go to Top