diff --git a/README.txt b/README.txt
index 041cf53..47be483 100644
--- a/README.txt
+++ b/README.txt
@@ -135,6 +135,26 @@ The maximum number of calls to lock_wait() due to stampede protection during a
 single request, defaults to 3:
   $conf['memcache_stampede_wait_limit'] = 3;
 
+Memcache stampede protected relies on a cache_set after the cache_get. Some
+usages like module_implements() cache writes the data later, see
+drupal_page_footer()/module_implements_write_cache(). Allow to disable the
+protection for those cases.
+
+  $conf['memcache_stampede_protection_ignore'] = array(
+    // Ignore the entire cache_render bin.
+    'cache_render',
+    // Ignore some CIDs of cache_bootstrap.
+    'cache_bootstrap' => array(
+      'module_implements',
+      'variables'
+    ),
+    // Ignore all CIDs starting with 'i18n:'
+    'cache' => array(
+      'i18n:*',
+    ),
+  );
+
+
 When adjusting these variables, be aware that:
  - there is unlikely to be a good use case for setting wait_time higher
    than stampede_semaphore;
diff --git a/memcache.inc b/memcache.inc
index 3a06988..bd470c9 100644
--- a/memcache.inc
+++ b/memcache.inc
@@ -103,7 +103,7 @@ class MemCacheDrupal implements DrupalCacheInterface {
         if (variable_get('memcache_stampede_protection', FALSE)) {
           // The process that acquires the lock will get a cache miss, all
           // others will get a cache hit.
-          if ($this->lockInit() && lock_acquire("memcache_$cid:$this->bin", variable_get('memcache_stampede_semaphore', 15))) {
+          if ($this->lockInit() && $this->stampedeProtected($cid) && lock_acquire("memcache_$cid:$this->bin", variable_get('memcache_stampede_semaphore', 15))) {
             $cache = FALSE;
           }
         }
@@ -144,7 +144,7 @@ class MemCacheDrupal implements DrupalCacheInterface {
     // On cache misses, attempt to avoid stampedes when the
     // memcache_stampede_protection variable is enabled.
     if (!$cache) {
-      if (variable_get('memcache_stampede_protection', FALSE) && $this->lockInit() && !lock_acquire("memcache_$cid:$this->bin", variable_get('memcache_stampede_semaphore', 15))) {
+      if (variable_get('memcache_stampede_protection', FALSE) && $this->lockInit() && $this->stampedeProtected($cid) && !lock_acquire("memcache_$cid:$this->bin", variable_get('memcache_stampede_semaphore', 15))) {
         // Prevent any single request from waiting more than three times due to
         // stampede protection. By default this is a maximum total wait of 15
         // seconds. This accounts for two possibilities - a cache and lock miss
@@ -480,6 +480,47 @@ class MemCacheDrupal implements DrupalCacheInterface {
   }
 
   /**
+   * Determines whether stampede protection is enabled for a given CID/bin.
+   *
+   * Memcache stampede protected relies on a cache_set after the cache_get. Some
+   * usages like module_implements() cache writes the data later, see
+   * drupal_page_footer()/module_implements_write_cache(). Allow to disable the
+   * protection for those cases.
+   *
+   * @param string $cid
+   *   The cache ID of the data to retrieve.
+   *
+   * @return bool
+   *   Returns TRUE if stampede protected is enabled for that particular cache
+   *   bin/cid, otherwise FALSE.
+   */
+  protected function stampedeProtected($cid) {
+    $ignore_settings = variable_get('memcache_stampede_protection_ignore', array());
+
+    // Support ignoring an entire bin.
+    if (in_array($this->bin, $ignore_settings)) {
+      return FALSE;
+    }
+
+    // Support ignoring by CIDs.
+    if (isset($ignore_settings[$this->bin])) {
+      // Support ignoring specific CIDs.
+      if (in_array($cid, $ignore_settings[$this->bin])) {
+        return FALSE;
+      }
+      // Support ignoring CIDs starting with a suffix.
+      foreach ($ignore_settings[$this->bin] as $ignore) {
+        $split = explode('*', $ignore);
+        if (count($split) > 1 && strpos($cid, $split[0]) === 0) {
+          return FALSE;
+        }
+      }
+    }
+
+    return TRUE;
+  }
+
+  /**
    * Helper function to reload variables.
    *
    * This is used by the tests to verify that the cache object used the correct
diff --git a/tests/memcache.test b/tests/memcache.test
index 0de0b54..adaee98 100644
--- a/tests/memcache.test
+++ b/tests/memcache.test
@@ -687,6 +687,77 @@ class MemCacheClearCase extends MemcacheTestCase {
 }
 
 /**
+ * Tests memcache stampede protection.
+ */
+class MemCacheStampedeProtection extends MemcacheTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Memcache stampede protection',
+      'description' => 'Tests memcache stampede protection.',
+      'group' => 'Memcache',
+    );
+  }
+
+  /**
+   * Tests the opt out functionality of stampede protection using a unit test.
+   */
+  public function testStampedeProtectionIgnoringUnit() {
+    global $conf;
+
+    // Setup a new test bin, to be able to override the used class.
+    $conf['cache_flush_test_bin'] = 0;
+    $conf['cache_class_test_bin'] = 'MockMemCacheDrupal';
+
+    $conf['cache_flush_test_bin_2'] = 0;
+    $conf['cache_class_test_bin_2'] = 'MockMemCacheDrupal';
+
+    // Setup stampede protection.
+    $conf['memcache_stampede_protection'] = TRUE;
+    $conf['memcache_stampede_protection_ignore'] = array(
+      'test_bin',
+      'test_bin_2' => array(
+        'cid_no_prefix',
+        'cid_with_prefix:*',
+      ),
+    );
+
+    // Ensure the mock object is used.
+    /** @var \MockMemCacheDrupal $cache_object_bin */
+    $cache_object_bin = _cache_get_object('test_bin');
+    $this->assertEqual(get_class($cache_object_bin), 'MockMemCacheDrupal');
+    /** @var \MockMemCacheDrupal $cache_object_bin2 */
+    $cache_object_bin2 = _cache_get_object('test_bin_2');
+    $this->assertEqual(get_class($cache_object_bin2), 'MockMemCacheDrupal');
+
+    // Test ignoring of an entire bin.
+    $this->assertFalse($cache_object_bin->stampedeProtected('test_cid'));
+    $this->assertFalse($cache_object_bin->stampedeProtected('cid_no_prefix'));
+    $this->assertFalse($cache_object_bin->stampedeProtected('cid_with_prefix:example'));
+
+    // Test ignoring of specific CIDs.
+    $this->assertTrue($cache_object_bin2->stampedeProtected('test_cid'));
+    $this->assertFalse($cache_object_bin2->stampedeProtected('cid_no_prefix'));
+    $this->assertFalse($cache_object_bin2->stampedeProtected('cid_with_prefix:example'));
+    $this->assertTrue($cache_object_bin2->stampedeProtected('cid_with_other_prefix:example'));
+  }
+
+}
+
+include_once dirname(__DIR__) . '/memcache.inc';
+
+/**
+ * Wraps the MemCacheDrupal class in order to be able to call a protected method.
+ */
+class MockMemCacheDrupal extends MemCacheDrupal {
+
+  public function stampedeProtected($cid) {
+    return parent::stampedeProtected($cid);
+  }
+
+}
+
+/**
  * Test some real world cache scenarios with default modules.
  *
  * Please make sure you've set the proper memcache settings in the settings.php.
