You are here

function ape_check_cacheable in Advanced Page Expiration 7

Check if global page caching is enabled and the user is anonymous.

Return value

bool True if the user is anonymous, caching is enabled and the path is not in the excludes list.

2 calls to ape_check_cacheable()
ape_set_cache_header in ./ape.module
Sets the cache control header.
hook_ape_cache_expiration_alter in ./ape.api.php
Alter the max_age before being set.

File

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

Code

function ape_check_cacheable() {
  if (user_is_anonymous() && variable_get('cache', 0) && drupal_page_is_cacheable()) {
    $excluded = ape_check_path(variable_get('ape_exclusions', ''), $_GET['q']);
    if (!$excluded) {
      return TRUE;
    }
  }
  else {
    return FALSE;
  }
}