You are here

function ape_cache_set in Advanced Page Expiration 7

Same name and namespace in other branches
  1. 8 ape.module \ape_cache_set()

Statically cache an expiration length from other modules.

Parameters

int $new_age: The new value for age.

Return value

int The resulting max age.

3 calls to ape_cache_set()
ape_drupal_goto_alter in ./ape.module
Implements hook_drupal_goto_alter().
ape_page_delivery_callback_alter in ./ape.module
Implements hook_page_delivery_callback_alter().
ape_redirect_alter in ./ape.module
Implements hook_redirect_alter().
1 string reference to 'ape_cache_set'
ape_rules_action_info in ./ape.rules.inc
Implements hook_rules_action_info().

File

./ape.module, line 190
Allows finer control of the Cache Control header.

Code

function ape_cache_set($new_age = NULL) {
  $max_age =& drupal_static(__FUNCTION__);
  if (!isset($max_age)) {
    $max_age = NULL;
  }
  if (is_null($max_age) && !is_null($new_age)) {
    $max_age = $new_age;
  }
  return $max_age;
}