 core/includes/common.inc                            |   19 +------------------
 core/lib/Drupal/Core/Cache/DatabaseBackend.php      |    2 +-
 .../Core/EventSubscriber/HtmlViewSubscriber.php     |    2 +-
 .../Core/Page/DefaultHtmlFragmentRenderer.php       |    4 ++++
 .../modules/menu/lib/Drupal/menu/Tests/MenuTest.php |    1 +
 .../lib/Drupal/node/Tests/NodePageCacheTest.php     |    5 ++++-
 .../Drupal/system/Tests/Bootstrap/PageCacheTest.php |    1 +
 .../Tests/Cache/PageCacheTagsIntegrationTest.php    |   10 +++++++++-
 8 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/core/includes/common.inc b/core/includes/common.inc
index d18c0c1..84364fe 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -3243,7 +3243,7 @@ function drupal_page_set_cache(Response $response, Request $request) {
         // because by the time it is read, the configuration might change.
         'page_compressed' => $page_compressed,
       ),
-      'tags' => array('content' => TRUE) + drupal_cache_tags_page_get($response),
+      'tags' => explode(' ', $response->headers->get('X-Drupal-Cache-Tags')),
       'expire' => Cache::PERMANENT,
       'created' => REQUEST_TIME,
     );
@@ -4486,23 +4486,6 @@ function drupal_render_collect_cache_tags($element, $tags = array()) {
 }
 
 /**
- * Return the cache tags that were stored during drupal_render_page().
- *
- * @param \Symfony\Component\HttpFoundation\Response $response
- *   The response object.
- * @return array
- *   An array of cache tags.
- *
- * @see \Drupal\Core\EventSubscriber\HtmlViewSubscriber::onHtmlPage()
- */
-function drupal_cache_tags_page_get(Response $response) {
-  if (($tags = $response->headers->get('cache_tags')) && $tags = unserialize($tags)) {
-    return $tags;
-  }
-  return array();
-}
-
-/**
  * Prepares an element for caching based on a query.
  *
  * This smart caching strategy saves Drupal from querying and rendering to HTML
diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackend.php b/core/lib/Drupal/Core/Cache/DatabaseBackend.php
index 4f98c50..0647faa 100644
--- a/core/lib/Drupal/Core/Cache/DatabaseBackend.php
+++ b/core/lib/Drupal/Core/Cache/DatabaseBackend.php
@@ -366,7 +366,7 @@ public function garbageCollection() {
    * @return array
    *   An indexed array of flattened tag identifiers.
    */
-  protected function flattenTags(array $tags) {
+  public static function flattenTags(array $tags) {
     if (isset($tags[0])) {
       return $tags;
     }
diff --git a/core/lib/Drupal/Core/EventSubscriber/HtmlViewSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/HtmlViewSubscriber.php
index 69e80cd..5945a1a 100644
--- a/core/lib/Drupal/Core/EventSubscriber/HtmlViewSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/HtmlViewSubscriber.php
@@ -77,7 +77,7 @@ public function onHtmlPage(GetResponseForControllerResultEvent $event) {
       // recommended.
       $response = new Response((string) $this->pageRenderer->render($page), $page->getStatusCode());
       if ($tags = $page->getCacheTags()) {
-        $response->headers->set('cache_tags', serialize($tags));
+        $response->headers->set('X-Drupal-Cache-Tags', implode(' ', \Drupal\Core\Cache\DatabaseBackend::flattenTags($tags)));
       }
       if ($keys = $page->getCacheKeys()) {
         $response->headers->set('cache_keys', serialize($keys));
diff --git a/core/lib/Drupal/Core/Page/DefaultHtmlFragmentRenderer.php b/core/lib/Drupal/Core/Page/DefaultHtmlFragmentRenderer.php
index 6e0c509..d95a0a6 100644
--- a/core/lib/Drupal/Core/Page/DefaultHtmlFragmentRenderer.php
+++ b/core/lib/Drupal/Core/Page/DefaultHtmlFragmentRenderer.php
@@ -51,6 +51,10 @@ public function render(HtmlFragment $fragment, $status_code = 200) {
     // Collect cache tags for all the content in all the regions on the page.
     $tags = drupal_render_collect_cache_tags($page_array);
 
+    // Enforce the generic "content" cache tag on all pages.
+    // @todo Remove the "content" cache tag. @see https://drupal.org/node/2124957
+    $tags['content'] = TRUE;
+
     // Build the HtmlPage object.
     $page = new HtmlPage('', array('tags' => $tags), $fragment->getTitle());
     $page = $this->preparePage($page, $page_array);
diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
index d926528..b1cc1c2 100644
--- a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
+++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
@@ -515,6 +515,7 @@ public function testMenuBlockPageCacheTags() {
     $cid_parts = array(url('test-page', array('absolute' => TRUE)), 'html');
     $cid = sha1(implode(':', $cid_parts));
     $cache_entry = \Drupal::cache('page')->get($cid);
+    sort($cache_entry->tags);
     $this->assertIdentical($cache_entry->tags, array('content:1', 'menu:llama'));
 
     // The "Llama" menu is modified.
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodePageCacheTest.php b/core/modules/node/lib/Drupal/node/Tests/NodePageCacheTest.php
index 0fc6ed2..70c3dc2 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodePageCacheTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodePageCacheTest.php
@@ -59,7 +59,10 @@ public function testNodeDelete() {
     $cid_parts = array(url($node_path, array('absolute' => TRUE)), 'html');
     $cid = sha1(implode(':', $cid_parts));
     $cache_entry = \Drupal::cache('page')->get($cid);
-    $this->assertIdentical($cache_entry->tags, array('content:1', 'node_view:' . $node_id,  'node:' . $node_id, 'user:' . $author->id(), 'filter_format:plain_text'));
+    sort($cache_entry->tags);
+    $expected_tags = array('content:1', 'node_view:' . $node_id,  'node:' . $node_id, 'user:' . $author->id(), 'filter_format:plain_text');
+    sort($expected_tags);
+    $this->assertIdentical($cache_entry->tags, $expected_tags);
 
     // Login and delete the node.
     $this->drupalLogin($this->adminUser);
diff --git a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php
index 3ca1f19..ec596fa 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php
@@ -65,6 +65,7 @@ function testPageCacheTags() {
     $cid_parts = array(url($path, array('absolute' => TRUE)), 'html');
     $cid = sha1(implode(':', $cid_parts));
     $cache_entry = \Drupal::cache('page')->get($cid);
+    sort($cache_entry->tags);
     $this->assertIdentical($cache_entry->tags, array('content:1', 'system_test_cache_tags_page:1'));
 
     Cache::invalidateTags($tags);
diff --git a/core/modules/system/lib/Drupal/system/Tests/Cache/PageCacheTagsIntegrationTest.php b/core/modules/system/lib/Drupal/system/Tests/Cache/PageCacheTagsIntegrationTest.php
index b245c34..1f0c39e 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Cache/PageCacheTagsIntegrationTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Cache/PageCacheTagsIntegrationTest.php
@@ -96,14 +96,22 @@ function testPageCacheTags() {
    *   The expected cache tags for the page cache entry of the given $path.
    */
   protected function verifyPageCacheTags($path, $expected_tags) {
+    sort($expected_tags);
     $this->drupalGet($path);
     $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS');
+    $actual_tags = explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Tags'));
+    sort($actual_tags);
+    $this->assertIdentical($actual_tags, $expected_tags);
     $this->drupalGet($path);
+    $actual_tags = explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Tags'));
+    sort($actual_tags);
     $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT');
+    $this->assertIdentical($actual_tags, $expected_tags);
     $cid_parts = array(url($path, array('absolute' => TRUE)), 'html');
     $cid = sha1(implode(':', $cid_parts));
     $cache_entry = \Drupal::cache('page')->get($cid);
-    $this->assertIdentical($cache_entry->tags, $expected_tags);
+    sort($cache_entry->tags);
+    $this->assertEqual($cache_entry->tags, $expected_tags);
   }
 
 }
