function hook_expire_cache in Cache Expiration 7.2
Provides possibility to flush pages for external cache storages.
Parameters
$urls: List of internal paths and/or absolute URLs that should be flushed.
Example of array (when base url include option is enabled): array( 'node/1' => 'http://example.com/node/1', 'news' => 'http://example.com/news', );
Example of array (when base url include option is disabled): array( 'node/1' => 'node/1', 'news' => 'news', );
$wildcards: Array with wildcards implementations for each internal path. Indicates whether should be executed wildcard cache flush.
Example: array( 'node/1' => FALSE, 'news' => TRUE, );
$object_type: Name of object type ('node', 'comment', 'user', etc).
$object: Object (node, comment, user, etc) for which expiration is executes.
See also
2 invocations of hook_expire_cache()
- ExpireAPI::executeExternalExpiration in includes/
expire.api.inc - Executes hook_cache_expire().
- expire_admin_settings_form in ./
expire.admin.inc - Settings form for actions with cached pages.
File
- ./
expire.api.php, line 44 - API documentation for Cache Expiration module.
Code
function hook_expire_cache($urls, $wildcards, $object_type, $object) {
module_load_include('inc', 'purge');
foreach ($urls as $url) {
$full_path = url($url, array(
'absolute' => TRUE,
));
purge_urls($full_path, $wildcards);
}
}