function drupal_page_is_cacheable

Determines the cacheability of the current page.


$allow_caching: Set to FALSE if you want to prevent this page from being cached.

Return value

TRUE if the current page can be cached, FALSE otherwise.

5 calls to drupal_page_is_cacheable()
drupal_page_get_cache in includes/
Retrieves the current page from the cache.
drupal_page_set_cache in includes/
Stores the current page in the cache.
drupal_session_initialize in includes/
Initializes the session handler, starting a session if needed.
drupal_set_message in includes/
Sets a message to display to the user.
form_set_cache in includes/
Stores a form in the cache.


includes/, line 1385


function drupal_page_is_cacheable($allow_caching = NULL) {
    $allow_caching_static =& drupal_static(__FUNCTION__, TRUE);
    if (isset($allow_caching)) {
        $allow_caching_static = $allow_caching;
    return $allow_caching_static && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD') && !drupal_is_cli();

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.