Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX Workspace aware NodeCacheEntryIdentifier #5083

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;

Expand Down Expand Up @@ -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);
Expand Down
Loading