page_get_cache

Definition

page_get_cache()
includes/bootstrap.inc, line 289

Description

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). Because the output handler is not activated, the resulting page will not get cached either.

Code

<?php
function page_get_cache() {
  global $user, $base_url;

  $cache = NULL;

  if (!$user->uid && $_SERVER['REQUEST_METHOD'] == 'GET' && count(drupal_set_message()) == 0) {
    $cache = cache_get($base_url . request_uri());

    if (empty($cache)) {
      ob_start();
    }
  }

  return $cache;
}
?>
 
 

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.