You are here

function varnish_flush_cache_manually in Varnish 5

Implementation of hook_flush_caches()

Flush caches on events like cron.

This borrows logic from cache_clear_all() to respect cache_lifetime.

1 string reference to 'varnish_flush_cache_manually'
varnish_menu in ./varnish.module
Implementation of hook_menu()

File

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

Code

function varnish_flush_cache_manually() {
  $destination = referer_uri();
  varnish_purge_all_pages();
  drupal_set_message('Varnish cache cleared.');
  drupal_goto($destination);
}