You are here

function akamai_purge_path in Akamai 7.3

Purges a path and its related paths from Akamai's cache.

If purge request queuing is enabled, the request will be queued and submitted to the CCU API when cron is run.

If purge request queing is not enabled, the purge request will be made immediately.

Parameters

string $path: The path being purged, such as "node/34".

  • If you provide an internal path (e.g. "node/34"), its alias will also be purged, if one exists. If an alias is provided, the corresponding system path will also be purged. Additional query arguments must be supplied in $options['query'], not included in $path.
  • The special string '<front>' generates a link to the site's base URL.

array $options: (optional) An associative array of additional options, with the following elements:

  • 'hostname': The hostname at which the path to be purged exists. If omitted, the hostname will be obtained from the akamai_get_hostname() function.
  • Additional elements as used by the url() function.

Return value

mixed A response object if the purge request was submitted successfully. FALSE if purge request submission or queing failed. TRUE if the request was queued.

See also

akamai_get_purge_paths()

3 calls to akamai_purge_path()
akamai_drush_clear_url in ./akamai.drush.inc
Callback function for ak-clear-url command.
akamai_page_cache_control_form_submit in ./akamai.module
Form submission handler for akamai_page_cache_control_form().
akamai_purge_entity in ./akamai.module
Purges an entity's path from Akamai's cache.

File

./akamai.module, line 268
Integration with Akamai CDN CCU API.

Code

function akamai_purge_path($path, array $options = array()) {
  $language = empty($options['language']) ? $GLOBALS['language_url'] : $options['language'];
  if (empty($options['hostname'])) {
    $hostname = akamai_get_hostname($language);
  }
  else {
    $hostname = $options['hostname'];
  }
  $paths = akamai_get_purge_paths($path, $options);
  return akamai_purge_paths($paths, $hostname);
}