diff --git includes/bootstrap.inc includes/bootstrap.inc
index 43e8ec3..7488427 100644
--- includes/bootstrap.inc
+++ includes/bootstrap.inc
@@ -861,6 +861,22 @@ function drupal_page_get_cache($check_only = FALSE) {
     if ($cache !== FALSE) {
       $cache_hit = TRUE;
     }
+    else {
+      // Cache miss. Avoid a stampede.
+      require_once DRUPAL_ROOT . '/' . variable_get('lock_inc', 'includes/lock.inc');
+      lock_initialize();
+      $name = $GLOBALS['base_root'] . request_uri();
+      if (!lock_acquire($name, 1)) {
+        // Some other request is building cache. Wait, then re-run this function.
+        header('X-Drupal-Cache: WAIT');
+        lock_wait($name);
+        return _drupal_page_get_cache();
+      }
+      else {
+        // Proceed with page build;  cache its result, then release the lock.
+        header('X-Drupal-Cache: MISS');
+      }
+    }
     return $cache;
   }
 }
@@ -2124,9 +2140,6 @@ function _drupal_bootstrap_page_cache() {
       // We are done.
       exit;
     }
-    else {
-      header('X-Drupal-Cache: MISS');
-    }
   }
 }
 
diff --git includes/common.inc includes/common.inc
index 777a37f..9b53681 100644
--- includes/common.inc
+++ includes/common.inc
@@ -4553,6 +4553,7 @@ function drupal_page_set_cache() {
         $cache->data['body'] = gzencode($cache->data['body'], 9, FORCE_GZIP);
       }
       cache_set($cache->cid, $cache->data, 'cache_page', $cache->expire);
+      lock_release($cache->cid);
     }
     return $cache;
   }
@@ -5196,7 +5197,7 @@ function drupal_render_cache_get($elements) {
   }
   $bin = isset($elements['#cache']['bin']) ? $elements['#cache']['bin'] : 'cache';
 
-  if (!empty($cid) && $cache = cache_get($cid, $bin)) {
+  if ($cache = cache_get($cid, $bin)) {
     // Add additional libraries, JavaScript, CSS and other data attached
     // to this element.
     if (isset($cache->data['#attached'])) {
@@ -5205,7 +5206,18 @@ function drupal_render_cache_get($elements) {
     // Return the rendered output.
     return $cache->data['#markup'];
   }
-  return FALSE;
+  else {
+    // Cache miss. Avoid a stampede.
+    if (!lock_acquire($cid, 1)) {
+      // Some other request is building cache. Wait, then re-run this function.
+      lock_wait($cid);
+      return drupal_render_cache_get($elements);
+    }
+    else {
+      // Proceed with rendering, cache the result, and then release the lock.
+      return FALSE;
+    }
+  }
 }
 
 /**
@@ -5241,6 +5253,7 @@ function drupal_render_cache_set(&$markup, $elements) {
   $bin = isset($elements['#cache']['bin']) ? $elements['#cache']['bin'] : 'cache';
   $expire = isset($elements['#cache']['expire']) ? $elements['#cache']['expire'] : CACHE_PERMANENT;
   cache_set($cid, $data, $bin, $expire);
+  lock_release($cid);
 }
 
 /**
diff --git includes/lock.inc includes/lock.inc
index 45e7e14..ad57de3 100644
--- includes/lock.inc
+++ includes/lock.inc
@@ -195,11 +195,16 @@ function lock_may_be_available($name) {
  */
 function lock_wait($name, $delay = 30) {
   $delay = (int) $delay;
-  while ($delay--) {
+  $sleep = 1;
+  while ($delay > 0) {
     // This function should only be called by a request that failed to get a
     // lock, so we sleep first to give the parallel request a chance to finish
     // and release the lock.
-    sleep(1);
+    sleep($sleep);
+    // After each sleep, double the value of $sleep, to reduce the potential
+    // for a lock stampede.
+    $delay = $delay - $sleep;
+    $sleep = min($sleep * 2, $delay);
     if (lock_may_be_available($name)) {
       // No longer need to wait.
       return FALSE;
