page_get_cache

Versions
4.6 – 5
page_get_cache()
6
page_get_cache($status_only = FALSE)

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).

Code

includes/bootstrap.inc, line 560

<?php
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;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.