From b6787ba43870109d9f794211059bcd19f89f5fad Mon Sep 17 00:00:00 2001 From: Denny Lubitz Date: Tue, 21 May 2024 08:56:13 +0200 Subject: [PATCH 1/2] BUGFIX Workspace aware NodeCacheEntryIdentifier --- Neos.Neos/Classes/Domain/Model/NodeCacheEntryIdentifier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Neos.Neos/Classes/Domain/Model/NodeCacheEntryIdentifier.php b/Neos.Neos/Classes/Domain/Model/NodeCacheEntryIdentifier.php index 936e0c6e427..efbf48f7da2 100644 --- a/Neos.Neos/Classes/Domain/Model/NodeCacheEntryIdentifier.php +++ b/Neos.Neos/Classes/Domain/Model/NodeCacheEntryIdentifier.php @@ -32,7 +32,7 @@ private function __construct( public static function fromNode(Node $node): self { - return new self('Node_' . $node->subgraphIdentity->contentStreamId->value + return new self('Node_' . $node->workspaceName->value . '_' . $node->dimensionSpacePoint->hash . '_' . $node->aggregateId->value); } From 0db90e304b93182cc89f2e46da825eb8ff6b7c5e Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Sun, 26 May 2024 09:41:26 +0200 Subject: [PATCH 2/2] TASK: Move `NodeCacheEntryIdentifier` to Fusion namespace --- .../Cache}/NodeCacheEntryIdentifier.php | 2 +- Neos.Neos/Classes/Fusion/Helper/CachingHelper.php | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) rename Neos.Neos/Classes/{Domain/Model => Fusion/Cache}/NodeCacheEntryIdentifier.php (96%) diff --git a/Neos.Neos/Classes/Domain/Model/NodeCacheEntryIdentifier.php b/Neos.Neos/Classes/Fusion/Cache/NodeCacheEntryIdentifier.php similarity index 96% rename from Neos.Neos/Classes/Domain/Model/NodeCacheEntryIdentifier.php rename to Neos.Neos/Classes/Fusion/Cache/NodeCacheEntryIdentifier.php index efbf48f7da2..40a9315a24f 100644 --- a/Neos.Neos/Classes/Domain/Model/NodeCacheEntryIdentifier.php +++ b/Neos.Neos/Classes/Fusion/Cache/NodeCacheEntryIdentifier.php @@ -12,7 +12,7 @@ declare(strict_types=1); -namespace Neos\Neos\Domain\Model; +namespace Neos\Neos\Fusion\Cache; use Neos\Flow\Annotations as Flow; use Neos\Cache\CacheAwareInterface; diff --git a/Neos.Neos/Classes/Fusion/Helper/CachingHelper.php b/Neos.Neos/Classes/Fusion/Helper/CachingHelper.php index 5901939576b..fb64a7a175b 100644 --- a/Neos.Neos/Classes/Fusion/Helper/CachingHelper.php +++ b/Neos.Neos/Classes/Fusion/Helper/CachingHelper.php @@ -22,7 +22,7 @@ use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Eel\ProtectedContextAwareInterface; use Neos\Flow\Annotations as Flow; -use Neos\Neos\Domain\Model\NodeCacheEntryIdentifier; +use Neos\Neos\Fusion\Cache\NodeCacheEntryIdentifier; use Neos\Neos\Fusion\Cache\CacheTag; use Neos\Neos\Fusion\Cache\CacheTagSet; @@ -56,6 +56,14 @@ public function nodeTag(iterable|Node $nodes): array return CacheTagSet::forNodeAggregatesFromNodes(Nodes::fromArray($nodes))->toStringArray(); } + /** + * Generate a `@cache` entry identifier for a given node: + * + * entryIdentifier { + * documentNode = ${Neos.Caching.entryIdentifierForNode(documentNode)} + * } + * + */ public function entryIdentifierForNode(Node $node): NodeCacheEntryIdentifier { return NodeCacheEntryIdentifier::fromNode($node);