? cache-anon.patch
? pgsc_HEAD.patch
Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.217
diff -u -p -r1.217 bootstrap.inc
--- includes/bootstrap.inc	17 Jul 2008 21:10:39 -0000	1.217
+++ includes/bootstrap.inc	18 Jul 2008 08:59:28 -0000
@@ -543,10 +543,18 @@ function variable_del($name) {
  *
  * Note: we do not serve cached pages when status messages are waiting (from
  * a redirected form submission which was completed).
+ *
+ * @param $status_only
+ *   When set to TRUE, retrieve the status of the page cache only
+ *   (whether it was started in this request or not).
  */
-function page_get_cache() {
+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' || $_SERVER['REQUEST_METHOD'] == 'HEAD') && count(drupal_set_message()) == 0) {
@@ -554,6 +562,7 @@ function page_get_cache() {
 
     if (empty($cache)) {
       ob_start();
+      $status = TRUE;
     }
   }
 
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.778
diff -u -p -r1.778 common.inc
--- includes/common.inc	17 Jul 2008 21:10:39 -0000	1.778
+++ includes/common.inc	18 Jul 2008 08:59:29 -0000
@@ -2490,7 +2490,7 @@ function _drupal_bootstrap_full() {
 function page_set_cache() {
   global $user, $base_root;
 
-  if (!$user->uid && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD') && count(drupal_get_messages(NULL, FALSE)) == 0) {
+  if (!$user->uid && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD') && page_get_cache(TRUE)) {
     // This will fail in some cases, see page_get_cache() for the explanation.
     if ($data = ob_get_contents()) {
       $cache = TRUE;
