-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAGETWO-80647: Fix PageCache: async rendering of blocks can corrupt l…
…ayout cache #8554 #9050 #11174 - Merge Pull Request #11174 from adrian-martinez-interactiv4/magento2:FR#FIX-PAGECACHE-LAYOUT-CACHE-KEY - Merged commits: 1. 3bdfa1b 2. 5a6a000 3. bf7df0d 4. 7feba6c 5. 1bb25ed 6. 0e830c1 7. 8a92e46 8. 0a69b5b 9. bd6ed7c 10. c6e2b39 11. 3cc51dc 12. 2ae9c26 13. 516b529 14. efa3edb 15. 3f60168
- Loading branch information
Showing
12 changed files
with
197 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
27 changes: 27 additions & 0 deletions
27
lib/internal/Magento/Framework/View/Layout/LayoutCacheKeyInterface.php
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Framework\View\Layout; | ||
|
||
/** | ||
* Interface LayoutCacheKeyInterface | ||
*/ | ||
interface LayoutCacheKeyInterface | ||
{ | ||
/** | ||
* Add cache key(s) for generating different cache id for same handles | ||
* | ||
* @param array|string $cacheKeys | ||
* @return void | ||
*/ | ||
public function addCacheKeys($cacheKeys); | ||
|
||
/** | ||
* Return cache keys array | ||
* | ||
* @return array | ||
*/ | ||
public function getCacheKeys(); | ||
} |
This file contains 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
43 changes: 43 additions & 0 deletions
43
lib/internal/Magento/Framework/View/Model/Layout/CacheKey.php
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Framework\View\Model\Layout; | ||
|
||
/** | ||
* Layout cache key model | ||
*/ | ||
class CacheKey implements \Magento\Framework\View\Layout\LayoutCacheKeyInterface | ||
{ | ||
/** | ||
* Cache keys to be able to generate different cache id for same handles | ||
* | ||
* @var array | ||
*/ | ||
private $cacheKeys = []; | ||
|
||
/** | ||
* Add cache key(s) for generating different cache id for same handles | ||
* | ||
* @param array|string $cacheKeys | ||
* @return void | ||
*/ | ||
public function addCacheKeys($cacheKeys) | ||
{ | ||
if (!is_array($cacheKeys)) { | ||
$cacheKeys = [$cacheKeys]; | ||
} | ||
$this->cacheKeys = array_merge($this->cacheKeys, $cacheKeys); | ||
} | ||
|
||
/** | ||
* Return cache keys array | ||
* | ||
* @return array | ||
*/ | ||
public function getCacheKeys() | ||
{ | ||
return $this->cacheKeys; | ||
} | ||
} |
Oops, something went wrong.