You are here

function boost_cache_expire in Boost 5

Expires the static file cache for a given page, or multiple pages matching a wildcard.

3 calls to boost_cache_expire()
boost_comment in ./boost.module
Implementation of hook_comment(). Acts on comment modification.
boost_nodeapi in ./boost.module
Implementation of hook_nodeapi(). Acts on nodes defined by other modules.
boost_user in ./boost.module
Implementation of hook_user(). Acts on user account actions.

File

./boost.api.inc, line 82
Implements the Boost API for static page caching.

Code

function boost_cache_expire($path, $wildcard = FALSE) {

  // TODO: handle wildcard.
  $alias = drupal_get_path_alias($path);
  $path = drupal_get_normal_path($path);

  // normalize path
  if (($filename = boost_file_path($path)) && file_exists($filename)) {
    @unlink($filename);
  }
  if ($alias != $path && ($symlink = boost_file_path($alias)) && is_link($symlink)) {
    @unlink($symlink);
  }
  return TRUE;
}