You are here

function page_get_cache in Drupal 6

Same name and namespace in other branches
  1. 4 includes/bootstrap.inc \page_get_cache()
  2. 5 includes/bootstrap.inc \page_get_cache()

Retrieve the current page from the cache.

Note: we do not serve cached pages when status messages are waiting (from a redirected form submission which was completed).

Parameters

$status_only: When set to TRUE, retrieve the status of the page cache only (whether it was started in this request or not).

4 calls to page_get_cache()
form_expand_ahah in includes/form.inc
Add AHAH information about a form element to the page to communicate with javascript. If #ahah[path] is set on an element, this additional javascript is added to the page header to attach the AHAH behaviors. See ahah.js for more information.
form_set_cache in includes/form.inc
Store a form in the cache.
page_set_cache in includes/common.inc
Store the current page in the cache.
_drupal_bootstrap in includes/bootstrap.inc

File

includes/bootstrap.inc, line 661
Functions that need to be loaded on every Drupal request.

Code

function page_get_cache($status_only = FALSE) {
  static $status = FALSE;
  global $user, $base_root;
  if ($status_only) {
    return $status;
  }
  $cache = NULL;
  if (!$user->uid && $_SERVER['REQUEST_METHOD'] == 'GET' && count(drupal_set_message()) == 0 && $_SERVER['SERVER_SOFTWARE'] !== 'PHP CLI') {
    $cache = cache_get($base_root . request_uri(), 'cache_page');
    if (empty($cache)) {
      ob_start();
      $status = TRUE;
    }
  }
  return $cache;
}