diff --git a/core/composer.json b/core/composer.json
index 78ef4f7..5210ed6 100644
--- a/core/composer.json
+++ b/core/composer.json
@@ -149,6 +149,9 @@
   },
   "scripts": {
     "pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
-    "post-autoload-dump": "Drupal\\Core\\Composer\\Composer::ensureHtaccess"
+    "post-autoload-dump": [
+      "Drupal\\Core\\Composer\\Composer::ensureHtaccess",
+      "Drupal\\Core\\Composer\\Composer::dumpDeploymentIdentifier"
+    ]
   }
 }
diff --git a/core/lib/Drupal/Core/Composer/Composer.php b/core/lib/Drupal/Core/Composer/Composer.php
index 12164c3..43232c6 100644
--- a/core/lib/Drupal/Core/Composer/Composer.php
+++ b/core/lib/Drupal/Core/Composer/Composer.php
@@ -24,6 +24,9 @@ public static function preAutoloadDump(Event $event) {
     $composer = $event->getComposer();
     $package = $composer->getPackage();
     $autoload = $package->getAutoload();
+    $autoload['files'] = array_merge($autoload['files'], [
+      'vendor/DeploymentIdentifier.php'
+    ]);
     $autoload['classmap'] = array_merge($autoload['classmap'], array(
       'vendor/symfony/http-foundation/Request.php',
       'vendor/symfony/http-foundation/ParameterBag.php',
@@ -32,7 +35,7 @@ public static function preAutoloadDump(Event $event) {
       'vendor/symfony/http-foundation/HeaderBag.php',
       'vendor/symfony/http-kernel/HttpKernel.php',
       'vendor/symfony/http-kernel/HttpKernelInterface.php',
-      'vendor/symfony/http-kernel/TerminableInterface.php',
+      'vendor/symfony/http-kernel/TerminableInterface.php'
     ));
     $package->setAutoload($autoload);
   }
@@ -70,4 +73,37 @@ public static function ensureHtaccess(Event $event) {
     }
   }
 
+  /**
+   * Generates the DeploymentIdentifier class.
+   *
+   * @param \Composer\Script\Event $event
+   */
+  public static function dumpDeploymentIdentifier(Event $event) {
+    $vendor_dir = $event->getComposer()->getConfig()->get('vendor-dir');
+    $hash = $event->getComposer()->getLocker()->getLockData()['hash'];
+
+    $lines = <<<EOT
+<?php
+
+namespace Drupal\Core\Composer;
+
+/**
+ * Provides the deployment identifier created by Composer.
+ *
+ * @see
+ */
+class DeploymentIdentifier implements DeploymentIdentifierInterface {
+
+  /**
+   * @return string
+   */
+  public function getIdentifier() {
+    return '$hash';
+  }
+
+}
+EOT;
+    file_put_contents($vendor_dir . '/DeploymentIdentifier.php', $lines . "\n");
+  }
+
 }
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index 2ddc3ee..0f0d5db 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -11,6 +11,7 @@
 use Drupal\Component\Utility\Crypt;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Component\Utility\UrlHelper;
+use Drupal\Core\Composer\DeploymentIdentifier;
 use Drupal\Core\Config\BootstrapConfigStorageFactory;
 use Drupal\Core\Config\NullStorage;
 use Drupal\Core\Database\Database;
@@ -975,8 +976,9 @@ protected function initializeSettings(Request $request) {
     if ($class_loader_class == get_class($this->classLoader)
         && Settings::get('class_loader_auto_detect', TRUE)
         && function_exists('apc_fetch')) {
+      $identifier = new DeploymentIdentifier();
       $prefix = Settings::getApcuPrefix('class_loader', $this->root);
-      $apc_loader = new \Symfony\Component\ClassLoader\ApcClassLoader($prefix, $this->classLoader);
+      $apc_loader = new \Symfony\Component\ClassLoader\ApcClassLoader($prefix . $identifier->getIdentifier(), $this->classLoader);
       $this->classLoader->unregister();
       $apc_loader->register();
       $this->classLoader = $apc_loader;
diff --git a/core/vendor/composer/LICENSE b/core/vendor/composer/LICENSE
index c8d57af..cc78956 100644
--- a/core/vendor/composer/LICENSE
+++ b/core/vendor/composer/LICENSE
@@ -1,4 +1,3 @@
-
 Copyright (c) 2015 Nils Adermann, Jordi Boggiano
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -18,4 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
-
diff --git a/core/vendor/composer/autoload_files.php b/core/vendor/composer/autoload_files.php
index 693fec9..7c1f72d 100644
--- a/core/vendor/composer/autoload_files.php
+++ b/core/vendor/composer/autoload_files.php
@@ -10,4 +10,5 @@
     $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
     $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
     $baseDir . '/lib/Drupal.php',
+    $vendorDir . '/DeploymentIdentifier.php',
 );
