You are here

function redirect_page_cache_clear in Redirect 7.2

Same name and namespace in other branches
  1. 7 redirect.module \redirect_page_cache_clear()

Clear a page from the page cache.

4 calls to redirect_page_cache_clear()
redirect_redirect_delete in ./redirect.module
Implements hook_redirect_delete().
redirect_redirect_insert in ./redirect.module
Implements hook_redirect_insert().
redirect_redirect_update in ./redirect.module
Implements hook_redirect_update().
redirect_settings_form_submit in ./redirect.admin.inc
Form submit handler; clears the page cache.

File

./redirect.module, line 1244

Code

function redirect_page_cache_clear($redirect = NULL) {
  if (!variable_get('redirect_page_cache', 0)) {
    return;
  }
  if (isset($redirect)) {
    $path = url($redirect->source, array(
      'absolute' => TRUE,
    ));

    // Use a wildcard to catch paths with query strings.
    cache_clear_all($path, 'cache_page', TRUE);
  }
  else {

    // Clear the entire page cache.
    cache_clear_all('*', 'cache_page', TRUE);
  }
}