Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.572 diff -u -F^f -r1.572 common.inc --- includes/common.inc 1 Sep 2006 08:44:25 -0000 1.572 +++ includes/common.inc 5 Sep 2006 05:37:07 -0000 @@ -1586,7 +1586,7 @@ function _drupal_bootstrap_full() { function page_set_cache() { global $user, $base_root; - if (!$user->uid && $_SERVER['REQUEST_METHOD'] == 'GET') { + if (!$user->uid && $_SERVER['REQUEST_METHOD'] == 'GET' && !drupal_get_messages(NULL, FALSE)) { // This will fail in some cases, see page_get_cache() for the explanation. if ($data = ob_get_contents()) { $cache = TRUE; Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.123 diff -u -F^f -r1.123 bootstrap.inc --- includes/bootstrap.inc 3 Sep 2006 07:08:24 -0000 1.123 +++ includes/bootstrap.inc 5 Sep 2006 05:37:08 -0000 @@ -317,8 +317,6 @@ function variable_del($name) { * * 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. */ function page_get_cache() { global $user, $base_root; @@ -582,14 +580,18 @@ function drupal_set_message($message = N * @param $type * (optional) Only return messages of this type. */ -function drupal_get_messages($type = NULL) { +function drupal_get_messages($type = NULL, $clear_queue = TRUE) { if ($messages = drupal_set_message()) { if ($type) { - unset($_SESSION['messages'][$type]); + if ($clear_queue) { + unset($_SESSION['messages'][$type]); + } return array($type => $messages[$type]); } else { - unset($_SESSION['messages']); + if ($clear_queue) { + unset($_SESSION['messages']); + } return $messages; } }