Skip to content

Commit

Permalink
Merge pull request #5083 from dlubitz/90/bugfix/node-cache-entry-iden…
Browse files Browse the repository at this point in the history
…tifier-workspace-aware

BUGFIX Workspace aware NodeCacheEntryIdentifier
  • Loading branch information
dlubitz authored Jun 14, 2024
2 parents baf35c3 + 0db90e3 commit 8cdcc5f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down
10 changes: 9 additions & 1 deletion Neos.Neos/Classes/Fusion/Helper/CachingHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8cdcc5f

Please sign in to comment.