You are here

function hook_expire_cache_alter in Cache Expiration 7.2

Provides possibility to change urls before they are expired.

Parameters

$urls: List of internal paths and/or absolute URLs that should be flushed.

Example of array: array( 'node-1' => 'node/1', 'reference-user-17' => 'user/17', );

$object_type: Name of object type ('node', 'comment', 'user', etc).

$object: Object (node, comment, user, etc) for which expiration is executes.

$absolute_urls_passed: Indicates whether absolute urls were passed (TRUE or FALSE). Currently this flag can be set to TRUE only from drush command or rules action.

See also

expire.api.inc

1 invocation of hook_expire_cache_alter()
ExpireAPI::executeExpiration in includes/expire.api.inc
Executes internal or external cache expiration.

File

./expire.api.php, line 76
API documentation for Cache Expiration module.

Code

function hook_expire_cache_alter(&$urls, $object_type, $object, $absolute_urls_passed) {
  if (!$absolute_urls_passed && isset($urls['node-1'])) {
    unset($urls['node-1']);

    // Do not expire node with nid 1.
  }
}