Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.77
diff -u -r1.77 form.inc
--- includes/form.inc	12 Mar 2006 09:28:12 -0000	1.77
+++ includes/form.inc	15 Mar 2006 06:01:34 -0000
@@ -69,6 +69,8 @@
     if (!variable_get('drupal_private_key', '')) {
       variable_set('drupal_private_key', mt_rand());
     }
+    // Prevent caching pages with form tokens.
+    drupal_set_page_cacheable(FALSE);
 
     $form['form_token'] = array('#type' => 'hidden', '#default_value' => md5(session_id() . $form['#token'] . variable_get('drupal_private_key', '')));
   }
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.526
diff -u -r1.526 common.inc
--- includes/common.inc	10 Mar 2006 17:06:48 -0000	1.526
+++ includes/common.inc	15 Mar 2006 06:01:35 -0000
@@ -1306,6 +1306,21 @@
   $locale = locale_initialize();
 }
 
+/** 
+ * set whether the page is cacheable.
+ */
+function drupal_set_page_cacheable($cacheable = NULL) {
+  static $cache = TRUE;
+  if (!is_null($cacheable)) {
+    $cache = $cacheable;
+  }
+  return $cache;
+}
+
+function drupal_get_page_cacheable() {
+  return drupal_set_page_cacheable();
+}
+
 /**
  * Store the current page in the cache.
  *
@@ -1322,7 +1337,7 @@
 function page_set_cache() {
   global $user, $base_url;
 
-  if (!$user->uid && $_SERVER['REQUEST_METHOD'] == 'GET') {
+  if (drupal_get_page_cacheable() && !$user->uid && $_SERVER['REQUEST_METHOD'] == 'GET') {
     // This will fail in some cases, see page_get_cache() for the explanation.
     if ($data = ob_get_contents()) {
       $cache = TRUE;
