Created
April 7, 2019 18:16
-
-
Save LionsAd/60b2fa2fcc602405010c1b075b1bb41a to your computer and use it in GitHub Desktop.
CFBackendPatch.diff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/web/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php b/web/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php | |
| --- a/web/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php | |
| +++ b/web/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php | |
| @@ -46,6 +46,9 @@ public function __construct($root, $site_path, CacheTagsChecksumInterface $check | |
| else { | |
| $this->backendClass = 'Drupal\Core\Cache\Apcu4Backend'; | |
| } | |
| + | |
| + $this->backendClass = 'Drupal\Core\Cache\CFAwareApcuBackend'; | |
| + //$this->backendClass = 'Drupal\Core\Cache\ShmBackend'; | |
| } | |
| /** | |
| diff --git a/web/core/lib/Drupal/Core/Cache/ChainedFastBackend.php b/web/core/lib/Drupal/Core/Cache/ChainedFastBackend.php | |
| --- a/web/core/lib/Drupal/Core/Cache/ChainedFastBackend.php | |
| +++ b/web/core/lib/Drupal/Core/Cache/ChainedFastBackend.php | |
| @@ -166,7 +166,10 @@ public function getMultiple(&$cids, $allow_invalid = FALSE) { | |
| $cache[$item->cid] = $item; | |
| // Don't write the cache tags to the fast backend as any cache tag | |
| // invalidation results in an invalidation of the whole fast backend. | |
| - $this->fastBackend->set($item->cid, $item->data, $item->expire); | |
| + if (!$allow_invalid || $item->valid) { | |
| + // @todo Add interface check. | |
| + $this->fastBackend->set($item->cid, $item->data, $item->expire, [], $items); | |
| + } | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment