drupal_page_get_cache

Versions
7
drupal_page_get_cache($check_only = FALSE)

Retrieve the current page from the cache.

Note: we do not serve cached pages to authenticated users, or to anonymous users when $_SESSION is non-empty. $_SESSION may contain status messages from a form submission, the contents of a shopping cart, or other user- specific content that should not be cached and displayed to other users.

Parameters

$check_only (optional) Set to TRUE to only return whether a previous call found a cache entry.

Return value

The cache object, if the page was found in the cache, NULL otherwise.

▾ 2 functions call drupal_page_get_cache()

_drupal_bootstrap_page_cache in includes/bootstrap.inc
Bootstrap page cache: Try to serve a page from cache.
_drupal_bootstrap_page_header in includes/bootstrap.inc
Bootstrap page header: Invoke hook_boot(), intialize locking system, and send default HTTP headers.

Code

includes/bootstrap.inc, line 791

<?php
function drupal_page_get_cache($check_only = FALSE) {
  global $base_root;
  static $cache_hit = FALSE;

  if ($check_only) {
    return $cache_hit;
  }

  if (drupal_page_is_cacheable()) {
    $cache = cache_get($base_root . request_uri(), 'cache_page');
    if ($cache !== FALSE) {
      $cache_hit = 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.