You are here

function varnish_comment in Varnish 6

Same name and namespace in other branches
  1. 5 varnish.module \varnish_comment()

Implementation of hook_comment()

Used to pick up cache_clearing events

File

./varnish.module, line 124
varnish.module Provide drupal hooks for integration with the Varnish control layer.

Code

function varnish_comment($comment, $op) {
  if (in_array($op, array(
    'insert',
    'update',
    'publish',
    'unpublish',
    'delete',
  )) && variable_get('varnish_cache_clear', VARNISH_DEFAULT_CLEAR) == VARNISH_DEFAULT_CLEAR) {
    varnish_purge_all_pages();
  }
}