diff --git a/core/core.services.yml b/core/core.services.yml
index c43da8c..c8ab515 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -100,6 +100,18 @@ services:
     factory_method: get
     factory_service: cache_factory
     arguments: [discovery]
+  page_cache_request_policy:
+    class: Drupal\Core\PageCache\DefaultRequestPolicy
+    tags:
+      - { name: service_collector, tag: page_cache_request_policy, call: addPolicy}
+  page_cache_response_policy:
+    class: Drupal\Core\PageCache\ChainResponsePolicy
+    tags:
+      - { name: service_collector, tag: page_cache_response_policy, call: addPolicy}
+  page_cache_kill_switch:
+    class: Drupal\Core\PageCache\ResponsePolicy\KillSwitch
+    tags:
+      - { name: page_cache_response_policy }
   config.manager:
     class: Drupal\Core\Config\ConfigManager
     arguments: ['@entity.manager', '@config.factory', '@config.typed', '@string_translation', '@config.storage', '@event_dispatcher']
@@ -716,7 +728,7 @@ services:
     class: Drupal\Core\EventSubscriber\FinishResponseSubscriber
     tags:
       - { name: event_subscriber }
-    arguments: ['@language_manager', '@config.factory']
+    arguments: ['@language_manager', '@config.factory', '@page_cache_request_policy', '@page_cache_response_policy']
   redirect_response_subscriber:
     class: Drupal\Core\EventSubscriber\RedirectResponseSubscriber
     arguments: ['@url_generator']
diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 8c96031..ea47056 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -390,30 +390,6 @@ function drupal_page_get_cache(Request $request) {
 }
 
 /**
- * Determines the cacheability of the current page.
- *
- * Note: we do not serve cached pages to authenticated users, or to anonymous
- * users when $_SESSION is non-empty. $_SESSION may contain status messages
- * from a form submission, the contents of a shopping cart, or other user-
- * specific content that should not be cached and displayed to other users.
- *
- * @param $allow_caching
- *   Set to FALSE if you want to prevent this page to get cached.
- *
- * @return
- *   TRUE if the current page can be cached, FALSE otherwise.
- */
-function drupal_page_is_cacheable($allow_caching = NULL) {
-  $allow_caching_static = &drupal_static(__FUNCTION__, TRUE);
-  if (isset($allow_caching)) {
-    $allow_caching_static = $allow_caching;
-  }
-
-  return $allow_caching_static && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD')
-    && PHP_SAPI !== 'cli';
-}
-
-/**
  * Sets an HTTP response header for the current page.
  *
  * Note: When sending a Content-Type header, always include a 'charset' type,
@@ -931,7 +907,7 @@ function drupal_set_message($message = NULL, $type = 'status', $repeat = FALSE)
     }
 
     // Mark this page as being uncacheable.
-    drupal_page_is_cacheable(FALSE);
+    \Drupal::service('page_cache_kill_switch')->trigger();
   }
 
   // Messages not set when DB connection fails.
diff --git a/core/includes/utility.inc b/core/includes/utility.inc
index 3192deb..ec6a20c 100644
--- a/core/includes/utility.inc
+++ b/core/includes/utility.inc
@@ -62,8 +62,8 @@ function drupal_rebuild(ClassLoader $classloader, Request $request) {
     $bin->deleteAll();
   }
 
-  // Disable the page cache.
-  drupal_page_is_cacheable(FALSE);
+  // Disable recording of cached pages.
+  \Drupal::service('page_cache_kill_switch')->trigger();
 
   drupal_flush_all_caches();
 
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index 5377c36..98afb29 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -19,6 +19,7 @@
 use Drupal\Core\DependencyInjection\YamlFileLoader;
 use Drupal\Core\Extension\ExtensionDiscovery;
 use Drupal\Core\Language\Language;
+use Drupal\Core\PageCache\RequestPolicyInterface;
 use Drupal\Core\PhpStorage\PhpStorageFactory;
 use Drupal\Core\Site\Settings;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -466,9 +467,8 @@ public function handlePageCache(Request $request) {
       $cache_enabled = $config->get('cache.page.use_internal');
     }
 
-    // If there is no session cookie and cache is enabled (or forced), try to
-    // serve a cached page.
-    if (!$request->cookies->has(session_name()) && $cache_enabled && drupal_page_is_cacheable()) {
+    $request_policy = \Drupal::service('page_cache_request_policy');
+    if ($cache_enabled && $request_policy->check($request) == RequestPolicyInterface::ALLOW) {
       // Get the page from the cache.
       $response = drupal_page_get_cache($request);
       // If there is a cached page, display it.
diff --git a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
index 1dca1ee..4d21bc1 100644
--- a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
@@ -11,6 +11,8 @@
 use Drupal\Core\Config\Config;
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Language\LanguageManagerInterface;
+use Drupal\Core\PageCache\RequestPolicyInterface;
+use Drupal\Core\PageCache\ResponsePolicyInterface;
 use Drupal\Core\Site\Settings;
 use Symfony\Component\HttpFoundation\BinaryFileResponse;
 use Symfony\Component\HttpFoundation\Request;
@@ -41,16 +43,36 @@ class FinishResponseSubscriber implements EventSubscriberInterface {
   protected $config;
 
   /**
+   * A policy rule determining the cacheability of a request.
+   *
+   * @var \Drupal\Core\PageCache\RequestPolicyInterface
+   */
+  protected $requestPolicy;
+
+  /**
+   * A policy rule determining the cacheability of the response.
+   *
+   * @var \Drupal\Core\PageCache\ResponsePolicyInterface
+   */
+  protected $responsePolicy;
+
+  /**
    * Constructs a FinishResponseSubscriber object.
    *
    * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
    *   The language manager object for retrieving the correct language code.
    * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
    *   A config factory for retrieving required config objects.
+   * @param \Drupal\Core\PageCache\RequestPolicyInterface $request_policy
+   *   A policy rule determining the cacheability of a request.
+   * @param \Drupal\Core\PageCache\ResponsePolicyInterface $response_policy
+   *   A policy rule determining the cacheability of a response.
    */
-  public function __construct(LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory) {
+  public function __construct(LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory, RequestPolicyInterface $request_policy, ResponsePolicyInterface $response_policy) {
     $this->languageManager = $language_manager;
     $this->config = $config_factory->get('system.performance');
+    $this->requestPolicy = $request_policy;
+    $this->responsePolicy = $response_policy;
   }
 
   /**
@@ -83,16 +105,21 @@ public function onRespond(FilterResponseEvent $event) {
       $response->headers->set($name, $value, FALSE);
     }
 
-    $is_cacheable = drupal_page_is_cacheable();
+    $is_cacheable = ($this->requestPolicy->check($request) == RequestPolicyInterface::ALLOW) && ($this->responsePolicy->check($response, $request) != ResponsePolicyInterface::DENY);
 
     // Add headers necessary to specify whether the response should be cached by
     // proxies and/or the browser.
     if ($is_cacheable && $this->config->get('cache.page.max_age') > 0) {
       if (!$this->isCacheControlCustomized($response)) {
+        // Only add the default Cache-Control header if the controller did not
+        // specify one on the response.
         $this->setResponseCacheable($response, $request);
       }
     }
     else {
+      // If either the policy forbids caching or the sites configuration does
+      // not allow to add a max-age directive, then enforce a Cache-Control
+      // header declaring the response as not cacheable.
       $this->setResponseNotCacheable($response, $request);
     }
 
diff --git a/core/lib/Drupal/Core/PageCache/ChainRequestPolicy.php b/core/lib/Drupal/Core/PageCache/ChainRequestPolicy.php
new file mode 100644
index 0000000..0b87088
--- /dev/null
+++ b/core/lib/Drupal/Core/PageCache/ChainRequestPolicy.php
@@ -0,0 +1,69 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\PageCache\ChainRequestPolicy.
+ */
+
+namespace Drupal\Core\PageCache;
+
+use Symfony\Component\HttpFoundation\Request;
+
+/**
+ * Implements a compound request policy.
+ *
+ * When evaluating the compound policy, all of the contained rules are applied
+ * to the request. The overall result is computed according to the following
+ * rules:
+ *
+ * <ol>
+ *   <li>Returns static::DENY if any of the rules evaluated to static::DENY</li>
+ *   <li>Returns static::ALLOW if any of the rules evaluated to
+ *       static::ALLOW</li>
+ *   <li>Otherwise returns NULL</li>
+ * </ol>
+ */
+class ChainRequestPolicy implements ChainRequestPolicyInterface {
+
+  /**
+   * A list of policy rules to apply when this policy is evaluated.
+   *
+   * @var \Drupal\Core\PageCache\RequestPolicyInterface[]
+   */
+  protected $rules = [];
+
+  /**
+   * {@inheritdoc}
+   */
+  public function check(Request $request) {
+    $deny = FALSE;
+    $allow = FALSE;
+
+    foreach ($this->rules as $rule) {
+      $result = $rule->check($request);
+      if ($result == static::ALLOW) {
+        $allow = $result;
+      }
+      elseif ($result == static::DENY) {
+        $deny = $result;
+        break;
+      }
+    }
+
+    if ($deny) {
+      return $deny;
+    }
+    elseif ($allow) {
+      return $allow;
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function addPolicy(RequestPolicyInterface $policy) {
+    $this->rules[] = $policy;
+    return $this;
+  }
+
+}
diff --git a/core/lib/Drupal/Core/PageCache/ChainRequestPolicyInterface.php b/core/lib/Drupal/Core/PageCache/ChainRequestPolicyInterface.php
new file mode 100644
index 0000000..e8548df
--- /dev/null
+++ b/core/lib/Drupal/Core/PageCache/ChainRequestPolicyInterface.php
@@ -0,0 +1,25 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\PageCache\ChainRequestPolicyInterface.
+ */
+
+namespace Drupal\Core\PageCache;
+
+/**
+ * Defines the interface for compound request policies.
+ */
+interface ChainRequestPolicyInterface extends RequestPolicyInterface {
+
+  /**
+   * Add a policy to the list of policy rules.
+   *
+   * @param \Drupal\Core\PageCache\RequestPolicyInterface $policy
+   *   The request policy rule to add.
+   *
+   * @return $this
+   */
+  public function addPolicy(RequestPolicyInterface $policy);
+
+}
diff --git a/core/lib/Drupal/Core/PageCache/ChainResponsePolicy.php b/core/lib/Drupal/Core/PageCache/ChainResponsePolicy.php
new file mode 100644
index 0000000..606328b
--- /dev/null
+++ b/core/lib/Drupal/Core/PageCache/ChainResponsePolicy.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * @file
+ * Contains \Drupal\Core\PageCache\ChainResponsePolicy.
+ */
+
+namespace Drupal\Core\PageCache;
+
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+
+/**
+ * Implements a compound response policy.
+ *
+ * When evaluating the compound policy, all of the contained rules are applied
+ * to the response. The overall result is computed according to the following
+ * rules:
+ *
+ * <ol>
+ *   <li>Returns static::DENY if any of the rules evaluated to static::DENY</li>
+ *   <li>Otherwise returns NULL</li>
+ * </ol>
+ */
+class ChainResponsePolicy implements ChainResponsePolicyInterface {
+
+  /**
+   * A list of policy rules to apply when this policy is checked.
+   *
+   * @var \Drupal\Core\PageCache\ResponsePolicyInterface[]
+   */
+  protected $rules = [];
+
+  /**
+   * {@inheritdoc}
+   */
+  public function check(Response $response, Request $request) {
+    foreach ($this->rules as $rule) {
+      if ($rule->check($response, $request) == static::DENY) {
+        return static::DENY;
+      }
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function addPolicy(ResponsePolicyInterface $policy) {
+    $this->rules[] = $policy;
+    return $this;
+  }
+
+}
diff --git a/core/lib/Drupal/Core/PageCache/ChainResponsePolicyInterface.php b/core/lib/Drupal/Core/PageCache/ChainResponsePolicyInterface.php
new file mode 100644
index 0000000..5018f19
--- /dev/null
+++ b/core/lib/Drupal/Core/PageCache/ChainResponsePolicyInterface.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * @file
+ * Contains \Drupal\Core\PageCache\ChainResponsePolicyInterface.
+ */
+
+namespace Drupal\Core\PageCache;
+
+/**
+ * Defines the interface for compound request policies.
+ */
+interface ChainResponsePolicyInterface extends ResponsePolicyInterface {
+
+  /**
+   * Add a policy to the list of policy rules.
+   *
+   * @param \Drupal\Core\PageCache\ResponsePolicyInterface $policy
+   *   The request policy rule to add.
+   *
+   * @return $this
+   */
+  public function addPolicy(ResponsePolicyInterface $policy);
+
+}
diff --git a/core/lib/Drupal/Core/PageCache/DefaultRequestPolicy.php b/core/lib/Drupal/Core/PageCache/DefaultRequestPolicy.php
new file mode 100644
index 0000000..b327753
--- /dev/null
+++ b/core/lib/Drupal/Core/PageCache/DefaultRequestPolicy.php
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\PageCache\DefaultRequestPolicy.
+ */
+
+namespace Drupal\Core\PageCache;
+
+/**
+ * The default page cache request policy.
+ *
+ * Delivery of cached pages is denied if either the application is running from
+ * the command line or the request was not initiated with a safe method (GET or
+ * HEAD). Also caching is only allowed for requests without a session cookie.
+ */
+class DefaultRequestPolicy extends ChainRequestPolicy {
+
+  /**
+   * Constructs the default page cache request policy.
+   */
+  public function __construct() {
+    $this->addPolicy(new RequestPolicy\CommandLineOrUnsafeMethod());
+    $this->addPolicy(new RequestPolicy\NoSessionOpen());
+  }
+
+}
diff --git a/core/lib/Drupal/Core/PageCache/RequestPolicy/CommandLineOrUnsafeMethod.php b/core/lib/Drupal/Core/PageCache/RequestPolicy/CommandLineOrUnsafeMethod.php
new file mode 100644
index 0000000..b2dde0e
--- /dev/null
+++ b/core/lib/Drupal/Core/PageCache/RequestPolicy/CommandLineOrUnsafeMethod.php
@@ -0,0 +1,38 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\PageCache\RequestPolicy\CommandLineOrUnsafeMethod.
+ */
+
+namespace Drupal\Core\PageCache\RequestPolicy;
+
+use Drupal\Core\PageCache\RequestPolicyInterface;
+use Symfony\Component\HttpFoundation\Request;
+
+/**
+ * Reject when running from the command line or when HTTP method is not safe.
+ *
+ * The policy denies caching if the request was initiated from the command line
+ * interface (drush) or the request method is neither GET nor HEAD (see RFC
+ * 2616, section 9.1.1 - Safe Methods).
+ */
+class CommandLineOrUnsafeMethod implements RequestPolicyInterface {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function check(Request $request) {
+    if ($this->isCliRequest($request) || !$request->isMethodSafe()) {
+      return static::DENY;
+    }
+  }
+
+  /**
+   * Indicates whether this is a CLI request.
+   */
+  protected function isCliRequest(Request $request) {
+    return PHP_SAPI === 'cli';
+  }
+
+}
diff --git a/core/lib/Drupal/Core/PageCache/RequestPolicy/NoSessionOpen.php b/core/lib/Drupal/Core/PageCache/RequestPolicy/NoSessionOpen.php
new file mode 100644
index 0000000..b06b4b8
--- /dev/null
+++ b/core/lib/Drupal/Core/PageCache/RequestPolicy/NoSessionOpen.php
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\PageCache\RequestPolicy\NoSessionOpen.
+ */
+
+namespace Drupal\Core\PageCache\RequestPolicy;
+
+use Drupal\Core\PageCache\RequestPolicyInterface;
+use Symfony\Component\HttpFoundation\Request;
+
+/**
+ * A policy allowing delivery of cached pages when there is no session open.
+ *
+ * Do not serve cached pages to authenticated users, or to anonymous users when
+ * $_SESSION is non-empty. $_SESSION may contain status messages from a form
+ * submission, the contents of a shopping cart, or other userspecific content
+ * that should not be cached and displayed to other users.
+ */
+class NoSessionOpen implements RequestPolicyInterface {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function check(Request $request) {
+    if (!$request->cookies->has(session_name())) {
+      return static::ALLOW;
+    }
+  }
+
+}
diff --git a/core/lib/Drupal/Core/PageCache/RequestPolicyInterface.php b/core/lib/Drupal/Core/PageCache/RequestPolicyInterface.php
new file mode 100644
index 0000000..17c2771
--- /dev/null
+++ b/core/lib/Drupal/Core/PageCache/RequestPolicyInterface.php
@@ -0,0 +1,41 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\PageCache\RequestPolicyInterface.
+ */
+
+namespace Drupal\Core\PageCache;
+
+use Symfony\Component\HttpFoundation\Request;
+
+/**
+ * Defines the interface for request policy implementations.
+ *
+ * The request policy is evaluated in order to determine whether delivery of a
+ * cached page should be attempted. Calling should do so if static::ALLOW is
+ * returned from the check() method.
+ */
+interface RequestPolicyInterface {
+
+  /**
+   * Allow delivery of cached pages.
+   */
+  const ALLOW = 'allow';
+
+  /**
+   * Deny delivery of cached pages.
+   */
+  const DENY = 'deny';
+
+  /**
+   * Determines whether delivery of a cached page should be attempted.
+   *
+   * @return string|NULL
+   *   One of static::ALLOW, static::DENY or NULL. Calling code may attempt to
+   *   deliver a cached page if static::ALLOW is returned. Returns NULL if the
+   *   policy is not specified for the given request.
+   */
+  public function check(Request $request);
+
+}
diff --git a/core/lib/Drupal/Core/PageCache/ResponsePolicy/KillSwitch.php b/core/lib/Drupal/Core/PageCache/ResponsePolicy/KillSwitch.php
new file mode 100644
index 0000000..62ecc45
--- /dev/null
+++ b/core/lib/Drupal/Core/PageCache/ResponsePolicy/KillSwitch.php
@@ -0,0 +1,42 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\PageCache\ResponsePolicy\KillSwitch.
+ */
+
+namespace Drupal\Core\PageCache\ResponsePolicy;
+
+use Drupal\Core\PageCache\ResponsePolicyInterface;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+
+/**
+ * A policy evaluating to static::DENY when the kill switch was triggered.
+ */
+class KillSwitch implements ResponsePolicyInterface {
+
+  /**
+   * A flag indicating whether the kill switch was triggered.
+   *
+   * @var bool
+   */
+  protected $kill = FALSE;
+
+  /**
+   * {@inheritdoc}
+   */
+  public function check(Response $response, Request $request) {
+    if ($this->kill) {
+      return static::DENY;
+    }
+  }
+
+  /**
+   * Deny any page caching on the current request.
+   */
+  public function trigger() {
+    $this->kill = TRUE;
+  }
+
+}
diff --git a/core/lib/Drupal/Core/PageCache/ResponsePolicyInterface.php b/core/lib/Drupal/Core/PageCache/ResponsePolicyInterface.php
new file mode 100644
index 0000000..7e76977
--- /dev/null
+++ b/core/lib/Drupal/Core/PageCache/ResponsePolicyInterface.php
@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\PageCache\ResponsePolicyInterface.
+ */
+
+namespace Drupal\Core\PageCache;
+
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+
+/**
+ * Defines the interface for response policy implementations.
+ *
+ * The response policy is evaluated in order to determine whether a page should
+ * be stored a in the cache. Calling code should do so unless static::DENY is
+ * returned from the check() method.
+ */
+interface ResponsePolicyInterface {
+
+  /**
+   * Deny storage of a page in the cache.
+   */
+  const DENY = 'deny';
+
+  /**
+   * Determines whether it is save to store a page in the cache.
+   *
+   * @return string|NULL
+   *   Either static::DENY or NULL. Calling code may attempt to store a page in
+   *   the cache unless static::DENY is returned. Returns NULL if the policy
+   *   policy is not specified for the given response.
+   */
+  public function check(Response $response, Request $request);
+
+}
diff --git a/core/lib/Drupal/Core/Session/SessionManager.php b/core/lib/Drupal/Core/Session/SessionManager.php
index df6cdee..f8739d24 100644
--- a/core/lib/Drupal/Core/Session/SessionManager.php
+++ b/core/lib/Drupal/Core/Session/SessionManager.php
@@ -132,9 +132,6 @@ public function startLazy() {
       // anonymous users not use a session cookie unless something is stored in
       // $_SESSION. This allows HTTP proxies to cache anonymous pageviews.
       $result = $this->start();
-      if ($user->isAuthenticated() || !$this->isSessionObsolete()) {
-        drupal_page_is_cacheable(FALSE);
-      }
     }
     else {
       // Set a session identifier for this request. This is necessary because
diff --git a/core/modules/image/image.services.yml b/core/modules/image/image.services.yml
index 1447e03..7f1f985 100644
--- a/core/modules/image/image.services.yml
+++ b/core/modules/image/image.services.yml
@@ -6,3 +6,8 @@ services:
   plugin.manager.image.effect:
     class: Drupal\image\ImageEffectManager
     parent: default_plugin_manager
+  image.page_cache_request_policy.deny_private_image_style_download:
+    class: Drupal\image\PageCache\DenyPrivateImageStyleDownload
+    arguments: ['@current_route_match']
+    tags:
+      - { name: page_cache_response_policy }
diff --git a/core/modules/image/src/Controller/ImageStyleDownloadController.php b/core/modules/image/src/Controller/ImageStyleDownloadController.php
index 3e4bcf0..a18c677 100644
--- a/core/modules/image/src/Controller/ImageStyleDownloadController.php
+++ b/core/modules/image/src/Controller/ImageStyleDownloadController.php
@@ -155,7 +155,6 @@ public function deliver(Request $request, $scheme, ImageStyleInterface $image_st
     }
 
     if ($success) {
-      drupal_page_is_cacheable(FALSE);
       $image = $this->imageFactory->get($derivative_uri);
       $uri = $image->getSource();
       $headers += array(
diff --git a/core/modules/image/src/PageCache/DenyPrivateImageStyleDownload.php b/core/modules/image/src/PageCache/DenyPrivateImageStyleDownload.php
new file mode 100644
index 0000000..8beba08
--- /dev/null
+++ b/core/modules/image/src/PageCache/DenyPrivateImageStyleDownload.php
@@ -0,0 +1,49 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\image\PageCache\DenyPrivateImageStyleDownload.
+ */
+
+namespace Drupal\image\PageCache;
+
+use Drupal\Core\PageCache\ResponsePolicyInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+
+/**
+ * Cache policy for image preview page.
+ *
+ * This policy rule denies caching of responses generated by the
+ * entity.image.preview route.
+ */
+class DenyPrivateImageStyleDownload implements ResponsePolicyInterface {
+
+  /**
+   * The current route match.
+   *
+   * @var \Drupal\Core\Routing\RouteMatchInterface
+   */
+  protected $routeMatch;
+
+  /**
+   * Constructs a deny image preview page cache policy.
+   *
+   * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
+   *   The current route match.
+   */
+  public function __construct(RouteMatchInterface $route_match) {
+    $this->routeMatch = $route_match;
+  }
+
+  /**
+   * Test whether this request goes to /image/preview.
+   */
+  public function check(Response $response, Request $request) {
+    if ($this->routeMatch->getRouteName() === 'image.style_private') {
+      return static::DENY;
+    }
+  }
+
+}
diff --git a/core/modules/node/node.services.yml b/core/modules/node/node.services.yml
index 546f47f..68f0af1 100644
--- a/core/modules/node/node.services.yml
+++ b/core/modules/node/node.services.yml
@@ -34,3 +34,8 @@ services:
     arguments: ['@user.tempstore']
     tags:
       - { name: paramconverter }
+  node.page_cache_request_policy.deny_node_preview:
+    class: Drupal\node\PageCache\DenyNodePreview
+    arguments: ['@current_route_match']
+    tags:
+      - { name: page_cache_response_policy }
diff --git a/core/modules/node/src/Controller/NodePreviewController.php b/core/modules/node/src/Controller/NodePreviewController.php
index 9fb8d13..35c65d9 100644
--- a/core/modules/node/src/Controller/NodePreviewController.php
+++ b/core/modules/node/src/Controller/NodePreviewController.php
@@ -20,9 +20,6 @@ class NodePreviewController extends EntityViewController {
    * {@inheritdoc}
    */
   public function view(EntityInterface $node_preview, $view_mode_id = 'full', $langcode = NULL) {
-    // Do not cache this page.
-    drupal_page_is_cacheable(FALSE);
-
     $node_preview->preview_view_mode = $view_mode_id;
     $build = array('nodes' => parent::view($node_preview, $view_mode_id));
 
diff --git a/core/modules/node/src/PageCache/DenyNodePreview.php b/core/modules/node/src/PageCache/DenyNodePreview.php
new file mode 100644
index 0000000..0f78018
--- /dev/null
+++ b/core/modules/node/src/PageCache/DenyNodePreview.php
@@ -0,0 +1,49 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\node\PageCache\DenyNodePreview.
+ */
+
+namespace Drupal\node\PageCache;
+
+use Drupal\Core\PageCache\ResponsePolicyInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+
+/**
+ * Cache policy for node preview page.
+ *
+ * This policy rule denies caching of responses generated by the
+ * entity.node.preview route.
+ */
+class DenyNodePreview implements ResponsePolicyInterface {
+
+  /**
+   * The current route match.
+   *
+   * @var \Drupal\Core\Routing\RouteMatchInterface
+   */
+  protected $routeMatch;
+
+  /**
+   * Constructs a deny node preview page cache policy.
+   *
+   * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
+   *   The current route match.
+   */
+  public function __construct(RouteMatchInterface $route_match) {
+    $this->routeMatch = $route_match;
+  }
+
+  /**
+   * Test whether this request goes to /node/preview.
+   */
+  public function check(Response $response, Request $request) {
+    if ($this->routeMatch->getRouteName() === 'entity.node.preview') {
+      return static::DENY;
+    }
+  }
+
+}
diff --git a/core/modules/toolbar/src/Controller/ToolbarController.php b/core/modules/toolbar/src/Controller/ToolbarController.php
index 11d17b4..5d47072 100644
--- a/core/modules/toolbar/src/Controller/ToolbarController.php
+++ b/core/modules/toolbar/src/Controller/ToolbarController.php
@@ -23,10 +23,22 @@ class ToolbarController extends ControllerBase {
    * @return \Symfony\Component\HttpFoundation\JsonResponse
    */
   public function subtreesJsonp() {
-    _toolbar_initialize_page_cache();
     $subtrees = toolbar_get_rendered_subtrees();
     $response = new JsonResponse($subtrees);
     $response->setCallback('Drupal.toolbar.setSubtrees.resolve');
+
+    // The Expires HTTP header is the heart of the client-side HTTP caching. The
+    // additional server-side page cache only takes effect when the client
+    // accesses the callback URL again (e.g., after clearing the browser cache
+    // or when force-reloading a Drupal page).
+    $max_age = 365 * 24 * 60 * 60;
+    $response->setPrivate();
+    $response->setMaxAge($max_age);
+
+    $expires = new \DateTime();
+    $expires->setTimestamp(REQUEST_TIME + $max_age);
+    $response->setExpires($expires);
+
     return $response;
   }
 
diff --git a/core/modules/toolbar/src/PageCache/AllowToolbarPath.php b/core/modules/toolbar/src/PageCache/AllowToolbarPath.php
new file mode 100644
index 0000000..bb331af
--- /dev/null
+++ b/core/modules/toolbar/src/PageCache/AllowToolbarPath.php
@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\toolbar\PageCache\AllowToolbarPath.
+ */
+
+namespace Drupal\toolbar\PageCache;
+
+use Drupal\Core\PageCache\RequestPolicyInterface;
+use Symfony\Component\HttpFoundation\Request;
+
+/**
+ * Cache policy for the toolbar page cache service.
+ *
+ * This policy allows caching of requests directed to /toolbar/subtrees/{hash}
+ * even for authenticated users.
+ */
+class AllowToolbarPath implements RequestPolicyInterface {
+
+  /**
+   * Test whether this request goes to /toolbar/subtrees.
+   */
+  public function check(Request $request) {
+    $path = $request->getPathInfo();
+    $toolbar_path_offset = strpos($path, '/toolbar/subtrees/');
+    if ($toolbar_path_offset !== FALSE) {
+      // Also accept paths matching at the first slash in order to cater for
+      // sites using language prefixes.
+      $second_slash = strpos($path, '/', 1);
+      if ($toolbar_path_offset === 0 || $toolbar_path_offset === $second_slash) {
+        return static::ALLOW;
+      }
+    }
+  }
+
+}
diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module
index 788378c..526b944 100644
--- a/core/modules/toolbar/toolbar.module
+++ b/core/modules/toolbar/toolbar.module
@@ -109,43 +109,6 @@ function toolbar_element_info() {
 }
 
 /**
- * Use Drupal's page cache for toolbar/subtrees/*, even for authenticated users.
- *
- * This gets invoked after full bootstrap, so must duplicate some of what's
- * done by \Drupal\Core\DrupalKernel::handlePageCache().
- *
- * @todo Replace this hack with something better integrated with DrupalKernel
- *   once Drupal's page caching itself is properly integrated.
- */
-function _toolbar_initialize_page_cache() {
-  $GLOBALS['conf']['system.performance']['cache']['page']['enabled'] = TRUE;
-  drupal_page_is_cacheable(TRUE);
-
-  // If we have a cache, serve it.
-  // @see \Drupal\Core\DrupalKernel::handlePageCache()
-  $request = \Drupal::request();
-  $response = drupal_page_get_cache($request);
-  if ($response) {
-    $response->headers->set('X-Drupal-Cache', 'HIT');
-
-    drupal_serve_page_from_cache($response, $request);
-
-    $response->prepare($request);
-    $response->send();
-    // We are done.
-    exit;
-  }
-
-  // The Expires HTTP header is the heart of the client-side HTTP caching. The
-  // additional server-side page cache only takes effect when the client
-  // accesses the callback URL again (e.g., after clearing the browser cache or
-  // when force-reloading a Drupal page).
-  $max_age = 3600 * 24 * 365;
-  drupal_add_http_header('Expires', gmdate(DateTimePlus::RFC7231, REQUEST_TIME + $max_age));
-  drupal_add_http_header('Cache-Control', 'private, max-age=' . $max_age);
-}
-
-/**
  * Implements hook_page_build().
  *
  * Add admin toolbar to the page_top region automatically.
diff --git a/core/modules/toolbar/toolbar.services.yml b/core/modules/toolbar/toolbar.services.yml
index 7f26968..278d3c7 100644
--- a/core/modules/toolbar/toolbar.services.yml
+++ b/core/modules/toolbar/toolbar.services.yml
@@ -6,3 +6,7 @@ services:
     factory_method: get
     factory_service: cache_factory
     arguments: [toolbar]
+  toolbar.page_cache_request_policy.allow_toolbar_path:
+    class: Drupal\toolbar\PageCache\AllowToolbarPath
+    tags:
+      - { name: page_cache_request_policy }
