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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

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

Run Cache Flush Command (for Varnish) on Publish

Go to End

9 Posts   2502 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