You are here

function fastly_expire_cache in Fastly 7.2

Same name and namespace in other branches
  1. 7 fastly.module \fastly_expire_cache()

Implements hook_expire_cache().

Provides integration with the Cache Expiration (expire) module.

File

./fastly.module, line 248
Fastly module.

Code

function fastly_expire_cache($urls, $wildcards, $object_type, $object) {
  $api = fastly_get_api();
  foreach ($urls as $url) {
    $api
      ->purgeQuery($url);
  }

  // For wildcards, we use the Surrogate-Key purging functionality.
  // Surrogate-Key headers are set in the response based on the
  // url path segments.
  // @See fastly_exit().
  if ($paths = array_keys($wildcards, TRUE)) {
    $api
      ->purgeKeys($paths);
  }
}