diff --git a/Neos.Neos/Classes/Domain/Model/NodeCacheEntryIdentifier.php b/Neos.Neos/Classes/Fusion/Cache/NodeCacheEntryIdentifier.php similarity index 89% rename from Neos.Neos/Classes/Domain/Model/NodeCacheEntryIdentifier.php rename to Neos.Neos/Classes/Fusion/Cache/NodeCacheEntryIdentifier.php index 936e0c6e427..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; @@ -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); } diff --git a/Neos.Neos/Classes/Fusion/Helper/CachingHelper.php b/Neos.Neos/Classes/Fusion/Helper/CachingHelper.php index 11e56aa3d26..b00b64498cd 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; use Neos\Neos\Fusion\Cache\CacheTagWorkspaceName; @@ -60,6 +60,14 @@ public function nodeTag(iterable|Node $nodes): array ); } + /** + * 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);