Skip to content
Snippets Groups Projects
Commit 51796e56 authored by Tim Steiner's avatar Tim Steiner
Browse files

[gh-204] Merging from testing into staging -c1204

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/staging@1216 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 32084462
No related branches found
No related tags found
No related merge requests found
......@@ -44,27 +44,19 @@ function unl_varnish_purge_submit($form, &$form_state) {
* Implements hook_file_insert().
*/
function unl_varnish_file_insert($file) {
_unl_varnish_purge_file($file);
varnish_purge_all_pages();
}
/**
* Implements hook_file_update().
*/
function unl_varnish_file_update($file) {
_unl_varnish_purge_file($file);
varnish_purge_all_pages();
}
/**
* Instructs varnish to purge the given file from its cache.
* @param stdClass $file as provided by hook_file_[insert,update]
* Implements hook_node_update().
*/
function _unl_varnish_purge_file($file) {
$url = parse_url(file_create_url($file->uri));
$host = $url['host'];
$path = $url['path'];
$command = "purge req.http.host == $host && req.url ~ ^$path\$";
_varnish_terminal_run($command);
function unl_varnish_node_update($node) {
varnish_purge_all_pages();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment