You are here

function varnish_expire_cache in Varnish 6

Same name and namespace in other branches
  1. 7 varnish.module \varnish_expire_cache()

Implementation of hook_expire_cache

Takes an array from expire.module and issue purges.

You may also safely call this function directly with an array of local urls to purge.

1 call to varnish_expire_cache()
varnish_drush_purge in ./varnish.drush.inc
Callback for varnish-purge drush command.

File

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

Code

function varnish_expire_cache($paths) {
  $host = _varnish_get_host();
  $base = base_path();
  $purge = implode('$|^' . $base, $paths);
  $purge = '^' . $base . $purge . '$';
  varnish_purge($host, $purge);
}