diff --git a/core/lib/Drupal/Core/Cache/BackendChain.php b/core/lib/Drupal/Core/Cache/BackendChain.php
index 2ea1118..0cea142 100644
--- a/core/lib/Drupal/Core/Cache/BackendChain.php
+++ b/core/lib/Drupal/Core/Cache/BackendChain.php
@@ -222,19 +222,6 @@ public function garbageCollection() {
   }
 
   /**
-   * Implements Drupal\Core\Cache\CacheBackendInterface::isEmpty().
-   */
-  public function isEmpty() {
-    foreach ($this->backends as $backend) {
-      if (!$backend->isEmpty()) {
-        return FALSE;
-      }
-    }
-
-    return TRUE;
-  }
-
-  /**
    * {@inheritdoc}
    */
   public function removeBin() {
diff --git a/core/lib/Drupal/Core/Cache/CacheBackendInterface.php b/core/lib/Drupal/Core/Cache/CacheBackendInterface.php
index f604980..796573c 100644
--- a/core/lib/Drupal/Core/Cache/CacheBackendInterface.php
+++ b/core/lib/Drupal/Core/Cache/CacheBackendInterface.php
@@ -257,15 +257,4 @@ public function garbageCollection();
    * Remove a cache bin.
    */
   public function removeBin();
-
-  /**
-   * Checks if a cache bin is empty.
-   *
-   * A cache bin is considered empty if it does not contain any valid data for
-   * any cache ID.
-   *
-   * @return
-   *   TRUE if the cache bin specified is empty.
-   */
-  public function isEmpty();
 }
diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackend.php b/core/lib/Drupal/Core/Cache/DatabaseBackend.php
index 3ae9eac..3f15f43 100644
--- a/core/lib/Drupal/Core/Cache/DatabaseBackend.php
+++ b/core/lib/Drupal/Core/Cache/DatabaseBackend.php
@@ -494,24 +494,6 @@ protected function checksumTags($flat_tags) {
   }
 
   /**
-   * Implements Drupal\Core\Cache\CacheBackendInterface::isEmpty().
-   */
-  public function isEmpty() {
-    $this->garbageCollection();
-    $query = $this->connection->select($this->bin);
-    $query->addExpression('1');
-    try {
-      $result = $query->range(0, 1)
-        ->execute()
-        ->fetchField();
-    }
-    catch (\Exception $e) {
-      $this->catchException($e);
-    }
-    return empty($result);
-  }
-
-  /**
    * {@inheritdoc}
    */
   public function removeBin() {
diff --git a/core/lib/Drupal/Core/Cache/MemoryBackend.php b/core/lib/Drupal/Core/Cache/MemoryBackend.php
index ff65a34..8cd759c 100644
--- a/core/lib/Drupal/Core/Cache/MemoryBackend.php
+++ b/core/lib/Drupal/Core/Cache/MemoryBackend.php
@@ -216,13 +216,6 @@ protected function flattenTags(array $tags) {
   }
 
   /**
-   * Implements Drupal\Core\Cache\CacheBackendInterface::isEmpty().
-   */
-  public function isEmpty() {
-    return empty($this->cache);
-  }
-
-  /**
    * Implements Drupal\Core\Cache\CacheBackendInterface::garbageCollection()
    */
   public function garbageCollection() {
diff --git a/core/lib/Drupal/Core/Cache/NullBackend.php b/core/lib/Drupal/Core/Cache/NullBackend.php
index 2d5664d..d27bc13 100644
--- a/core/lib/Drupal/Core/Cache/NullBackend.php
+++ b/core/lib/Drupal/Core/Cache/NullBackend.php
@@ -100,13 +100,6 @@ public function invalidateAll() {}
   public function garbageCollection() {}
 
   /**
-   * Implements Drupal\Core\Cache\CacheBackendInterface::isEmpty().
-   */
-  public function isEmpty() {
-    return TRUE;
-  }
-
-  /**
    * {@inheritdoc}
    */
   public function removeBin() {}
diff --git a/core/lib/Drupal/Core/Cache/PhpBackend.php b/core/lib/Drupal/Core/Cache/PhpBackend.php
index 23ed324..646b2c9 100644
--- a/core/lib/Drupal/Core/Cache/PhpBackend.php
+++ b/core/lib/Drupal/Core/Cache/PhpBackend.php
@@ -234,14 +234,6 @@ protected function flattenTags(array $tags) {
   /**
    * {@inheritdoc}
    */
-  public function isEmpty() {
-    $names = $this->storage()->listAll();
-    return empty($names);
-  }
-
-  /**
-   * {@inheritdoc}
-   */
   public function garbageCollection() {
   }
 
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php
index 38ef433..d7869f7 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\filter\Tests;
 
 use Drupal\simpletest\WebTestBase;
+use Drupal\filter\Plugin\FilterInterface;
 
 /**
  * Tests the administrative functionality of the Filter module.
@@ -154,8 +155,6 @@ function testFilterAdmin() {
     $this->drupalGet('admin/config/content/formats/manage/' . $restricted);
     $this->assertFieldByName('filters[filter_html][settings][allowed_html]', $edit['filters[filter_html][settings][allowed_html]'], 'Allowed HTML tag added.');
 
-    $this->assertTrue(\Drupal::cache('filter')->isEmpty(), 'Cache cleared.');
-
     $elements = $this->xpath('//select[@name=:first]/following::select[@name=:second]', array(
       ':first' => 'filters[' . $first_filter . '][weight]',
       ':second' => 'filters[' . $second_filter . '][weight]',
@@ -302,4 +301,74 @@ function testUrlFilterAdmin() {
     $this->drupalPostForm('admin/config/content/formats/manage/basic_html', $edit, t('Save configuration'));
     $this->assertNoRaw(t('The text format %format has been updated.', array('%format' => 'Basic HTML')));
   }
+
+  /**
+   * Tests that changing filter properties clears the filter cache.
+   */
+  public function testFilterAdminClearsFilterCache() {
+    $restricted = 'restricted_html';
+    $original_markup = '<h4>Small headers</h4> small headers are <em>allowed</em> in restricted html by default';
+
+    // Check that the filter cache is empty for the test markup.
+    $cid = $this->computeFilterCacheId($original_markup, $restricted, '', TRUE);
+    $this->assertFalse(\Drupal::cache('filter')->get($cid));
+
+    // Check that the filter cache gets populated when check_markup is called.
+    $actual_markup = check_markup($original_markup, $restricted, '', TRUE);
+    $this->assertTrue(\Drupal::cache('filter')->get($cid));
+    $this->assertIdentical(strpos($actual_markup, '<h4>'), 0, 'The h4 tag is present in the resulting markup');
+
+    // Edit the restricted filter format.
+    $edit = array();
+    $edit['filters[filter_html][settings][allowed_html]'] = '<a> <em> <strong> <cite> <code>';
+    $this->drupalPostForm('admin/config/content/formats/manage/' . $restricted, $edit, t('Save configuration'));
+    $this->assertUrl('admin/config/content/formats');
+    $this->drupalGet('admin/config/content/formats/manage/' . $restricted);
+    $this->assertFieldByName('filters[filter_html][settings][allowed_html]', $edit['filters[filter_html][settings][allowed_html]'], 'Allowed HTML tag added.');
+
+    // Check that the filter cache is empty after the format was changed.
+    $this->assertFalse(\Drupal::cache('filter')->get($cid));
+
+    // Check that after changind the filter, the changes are reflected in the
+    // filtered markup.
+    $actual_markup = check_markup($original_markup, $restricted, '', TRUE);
+    $this->assertIdentical(strpos($actual_markup, '<h4>'), FALSE, 'The h4 tag is not present in the resulting markup');
+  }
+
+
+  /**
+   * Computes the cache-key for the given text just like check_markup().
+   *
+   * Note that this is copied over from check_markup().
+   *
+   * @return string|NULL
+   *   The cache-key used to store the text in the filter cache.
+   */
+  protected function computeFilterCacheId($text, $format_id = NULL, $langcode = '', $cache = FALSE, $filter_types_to_skip = array()) {
+    if (!isset($format_id)) {
+      $format_id = filter_fallback_format();
+    }
+    // If the requested text format does not exist, the text cannot be filtered.
+    if (!$format = entity_load('filter_format', $format_id)) {
+      return;
+    }
+
+    // Prevent FilterInterface::TYPE_HTML_RESTRICTOR from being skipped.
+    if (in_array(FilterInterface::TYPE_HTML_RESTRICTOR, $filter_types_to_skip)) {
+      $filter_types_to_skip = array_diff($filter_types_to_skip, array(FilterInterface::TYPE_HTML_RESTRICTOR));
+    }
+
+    // When certain filters should be skipped, don't perform caching.
+    if ($filter_types_to_skip) {
+      $cache = FALSE;
+    }
+
+    // Compute the cache key if the text is cacheable.
+    $cache = $cache && !empty($format->cache);
+    $cache_id = '';
+    if ($cache) {
+      return $format->format . ':' . $langcode . ':' . hash('sha256', $text);
+    }
+  }
+
 }
diff --git a/core/modules/system/lib/Drupal/system/Tests/Cache/GenericCacheBackendUnitTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Cache/GenericCacheBackendUnitTestBase.php
index b390429..bd89e2d 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Cache/GenericCacheBackendUnitTestBase.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Cache/GenericCacheBackendUnitTestBase.php
@@ -335,21 +335,6 @@ public function testSetMultiple() {
   }
 
   /**
-   * Tests Drupal\Core\Cache\CacheBackendInterface::isEmpty().
-   */
-  public function testIsEmpty() {
-    $backend = $this->getCacheBackend();
-
-    $this->assertTrue($backend->isEmpty(), "Backend is empty.");
-
-    $backend->set('pony', "Shetland");
-    $this->assertFalse($backend->isEmpty(), "Backend is not empty.");
-
-    $backend->delete('pony');
-    $this->assertTrue($backend->isEmpty(), "Backend is empty.");
-  }
-
-  /**
    * Test Drupal\Core\Cache\CacheBackendInterface::delete() and
    * Drupal\Core\Cache\CacheBackendInterface::deleteMultiple().
    */
@@ -456,17 +441,18 @@ function testDeleteTags() {
    */
   public function testDeleteAll() {
     $backend = $this->getCacheBackend();
+    $unrelated = $this->getCacheBackend('bootstrap');
 
     // Set both expiring and permanent keys.
     $backend->set('test1', 1, Cache::PERMANENT);
     $backend->set('test2', 3, time() + 1000);
+    $unrelated->set('test3', 4, Cache::PERMANENT);
 
     $backend->deleteAll();
 
-    $this->assertTrue($backend->isEmpty(), "Backend is empty after deleteAll().");
-
     $this->assertFalse($backend->get('test1'), 'First key has been deleted.');
     $this->assertFalse($backend->get('test2'), 'Second key has been deleted.');
+    $this->assertTrue($unrelated->get('test3'), 'Item in other bin is preserved.');
   }
 
   /**
@@ -563,15 +549,18 @@ function testInvalidateTags() {
    */
   public function testInvalidateAll() {
     $backend = $this->getCacheBackend();
+    $unrelated = $this->getCacheBackend('bootstrap');
 
     // Set both expiring and permanent keys.
     $backend->set('test1', 1, Cache::PERMANENT);
     $backend->set('test2', 3, time() + 1000);
+    $unrelated->set('test3', 4, Cache::PERMANENT);
 
     $backend->invalidateAll();
 
     $this->assertFalse($backend->get('test1'), 'First key has been invalidated.');
     $this->assertFalse($backend->get('test2'), 'Second key has been invalidated.');
+    $this->assertTrue($unrelated->get('test3'), 'Item in other bin is preserved.');
     $this->assertTrue($backend->get('test1', TRUE), 'First key has not been deleted.');
     $this->assertTrue($backend->get('test2', TRUE), 'Second key has not been deleted.');
   }
diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module
index 0f58cb2..dc15135 100644
--- a/core/modules/toolbar/toolbar.module
+++ b/core/modules/toolbar/toolbar.module
@@ -588,14 +588,11 @@ function _toolbar_get_user_cid($uid, $langcode) {
  *   (optional) The user ID whose toolbar cache entry to clear.
  */
 function _toolbar_clear_user_cache($uid = NULL) {
-  $cache = \Drupal::cache('toolbar');
-  if (!$cache->isEmpty()) {
-    // Clear by the 'user' tag in order to delete all caches, in any language,
-    // associated with this user.
-    if (isset($uid)) {
-      Cache::deleteTags(array('user' => array($uid)));
-    } else {
-      $cache->deleteAll();
-    }
+  // Clear by the 'user' tag in order to delete all caches, in any language,
+  // associated with this user.
+  if (isset($uid)) {
+    Cache::deleteTags(array('user' => array($uid)));
+  } else {
+    \Drupal::cache('toolbar')->deleteAll();
   }
 }
diff --git a/core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php b/core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php
index 75c0a97..1cf617b 100644
--- a/core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php
@@ -204,20 +204,6 @@ public function testGetMultipleHasPropagated() {
   }
 
   /**
-   * Test that the chain is not empty when at least one backend has data.
-   */
-  public function testNotEmptyIfOneBackendHasTheKey() {
-    $this->assertFalse($this->chain->isEmpty(), 'Chain is not empty');
-
-    // This is the only test that needs to start with an empty chain.
-    $this->chain->deleteAll();
-    $this->assertTrue($this->chain->isEmpty(), 'Chain have been emptied by the deleteAll() call');
-
-    $this->secondBackend->set('test', 5);
-    $this->assertFalse($this->chain->isEmpty(), 'Chain is not empty anymore now that the second backend has something');
-  }
-
-  /**
    * Test that the delete all operation is propagated to all backends in the chain.
    */
   public function testDeleteAllPropagation() {
@@ -226,9 +212,12 @@ public function testDeleteAllPropagation() {
     $this->chain->set('test2', 3, time() + 1000);
     $this->chain->deleteAll();
 
-    $this->assertTrue($this->firstBackend->isEmpty(), 'First backend is empty after delete all.');
-    $this->assertTrue($this->secondBackend->isEmpty(), 'Second backend is empty after delete all.');
-    $this->assertTrue($this->thirdBackend->isEmpty(), 'Third backend is empty after delete all.');
+    $this->assertFalse($this->firstBackend->get('test1'), 'First key has been deleted in first backend.');
+    $this->assertFalse($this->firstBackend->get('test2'), 'Second key has been deleted in first backend.');
+    $this->assertFalse($this->secondBackend->get('test1'), 'First key has been deleted in second backend.');
+    $this->assertFalse($this->secondBackend->get('test2'), 'Second key has been deleted in second backend.');
+    $this->assertFalse($this->thirdBackend->get('test1'), 'First key has been deleted in third backend.');
+    $this->assertFalse($this->thirdBackend->get('test2'), 'Second key has been deleted in third backend.');
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/Core/Cache/NullBackendTest.php b/core/tests/Drupal/Tests/Core/Cache/NullBackendTest.php
index fc3a700..bb7e6ac 100644
--- a/core/tests/Drupal/Tests/Core/Cache/NullBackendTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/NullBackendTest.php
@@ -35,7 +35,6 @@ function testNullBackend() {
     $value = $this->randomName();
 
     $null_cache->set($key, $value);
-    $this->assertTrue($null_cache->isEmpty());
     $this->assertFalse($null_cache->get($key));
   }
 }
