You are here

purge.module in Purge 7.2

Same filename and directory in other branches
  1. 6 purge.module
  2. 7 purge.module

Purge clears url's from reverse proxy caches like Varnish and Squid by issuing HTTP PURGE requests.

File

purge.module
View source
<?php

/**
 * @file
 * Purge clears url's from reverse proxy caches like Varnish and Squid by
 * issuing HTTP PURGE requests.
 */

/**
 * Implements hook_expire_cache().
 *
 * @param array $expire_urls
 *   Takes an array from expire.module and issues purges.
 *   This can be either relative of fully qualified URLs.
 */
function purge_expire_cache($expire_urls) {
  module_load_include('inc', 'purge', 'includes/purge');

  // Just pass on to the purge_urls function which will do all the magic.
  $purge_requests = purge_urls($expire_urls);
}

/**
 * Callback for Queued purges.
 */
function purge_worker_callback($queue_items) {
  module_load_include('inc', 'purge', 'includes/purge');
  purge_queue_execute($queue_items['data']);
  return True;
}
function purge_finalize_callback($queue_items) {
}

/**
 * Implements hook_queue_runner_workers().
 *
 * @return array
 *   An array of workers to register.
 */
function purge_queue_runner_workers() {
  return array(
    'purge_worker_callback' => array(
      'callback' => 'purge_worker_callback',
      'finalize' => 'purge_finalize_callback',
    ),
  );
}

Functions

Namesort descending Description
purge_expire_cache Implements hook_expire_cache().
purge_finalize_callback
purge_queue_runner_workers Implements hook_queue_runner_workers().
purge_worker_callback Callback for Queued purges.