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 /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Run Cache Flush Command (for Varnish) on Publish

Go to End

9 Posts   2401 Views


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