You are here

function varnish_nodeapi in Varnish 6

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

Implementation of hook_nodeapi()

Used to pick up cache_clearing events

File

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

Code

function varnish_nodeapi(&$node, $op) {

  // We've probably just run through node_save, and normally this is where
  // Drupal calls a cache_clear_all().
  if (in_array($op, array(
    'insert',
    'update',
    'delete',
    'delete revision',
  )) && variable_get('varnish_cache_clear', VARNISH_DEFAULT_CLEAR) == VARNISH_DEFAULT_CLEAR) {
    varnish_purge_all_pages();
  }
}