You are here

function akamai_page_cache_control_form_submit in Akamai 7.3

Same name and namespace in other branches
  1. 6.2 akamai.module \akamai_page_cache_control_form_submit()
  2. 6 akamai.module \akamai_page_cache_control_form_submit()
  3. 7 akamai.module \akamai_page_cache_control_form_submit()
  4. 7.2 akamai.module \akamai_page_cache_control_form_submit()

Form submission handler for akamai_page_cache_control_form().

Purge the 'path' variable from the Akamai cache.

File

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

Code

function akamai_page_cache_control_form_submit($form, &$form_state) {
  $values = $form_state['values'];
  $path = $values['path'];
  $result = akamai_purge_path($path);
  if ($result === TRUE) {
    $message = t("A purge request for the path, %path, has been queued and will be submitted when cron runs.", array(
      '%path' => $path,
    ));
    drupal_set_message($message);
  }
  elseif (is_object($result)) {
    $message = t("A purge request for the path, %path, has been submitted to Akamai, please allow 10 minutes for changes to take effect.", array(
      '%path' => $path,
    ));
    drupal_set_message($message);
  }
  else {
    drupal_set_message(t("There was a problem submitting a purge request for this page. Check your log messages for more information."), 'error');
  }
}