class ContentCacheFlusher (View source)

This service flushes Fusion content caches triggered by node changes.

The method registerNodeChange() is triggered by a signal which is configured in the Package class of the Neos.Neos package (this package). Information on changed nodes is collected by this method and the respective Fusion content cache entries are flushed in one operation during Flow's shutdown procedure.

Properties

protected ContentCache $contentCache
protected LoggerInterface $systemLogger
protected array<string,string> $tagsToFlush
protected CachingHelper $cachingHelper
protected WorkspaceRepository $workspaceRepository
protected array $workspacesToFlush
protected array<string,string[]> $implementedNodeTypeNamesByNodeType
protected AssetService $assetService
protected NodeTypeManager $nodeTypeManager
protected ContentContextFactory $contextFactory
protected PersistenceManagerInterface $persistenceManager
protected ContentContext[] $contexts
protected Context $securityContext
protected bool $debugMode

Methods

void
registerNodeChange(NodeInterface $node, Workspace $targetWorkspace = null)

Register a node change for a later cache flush. This method is triggered by a signal sent via ContentRepository's Node model or the Neos Publishing Service.

void
addTagToFlush(string $tag, string $message = '')

No description

void
void
resolveWorkspaceChain(Workspace $workspace)

No description

void
resolveTagsForChildWorkspaces(Workspace $workspace, string $startingPoint)

No description

void
registerChangeOnNodeIdentifier(string $cacheIdentifier)

Pleas use registerNodeChange() if possible. This method is a low-level api. If you do use this method make sure that $cacheIdentifier contains the workspacehash as well as the node identifier: $workspaceHash .'_'. $nodeIdentifier The workspacehash can be received via $this->getCachingHelper()->renderWorkspaceTagForContextNode($workpsacename)

void
registerChangeOnNodeType(string $nodeTypeName, string $referenceNodeIdentifier = null, string $nodeTypePrefix = '')

This is a low-level api. Please use registerNodeChange() if possible. Otherwise make sure that $nodeTypePrefix is set up correctly and contains the workspacehash wich can be received via $this->getCachingHelper()->renderWorkspaceTagForContextNode($workpsacename)

void
registerAssetChange(AssetInterface $asset)

Fetches possible usages of the asset and registers nodes that use the asset as changed.

void
shutdownObject()

No description

void
commit()

Flush caches according to the previously registered node changes.

array
getAllImplementedNodeTypeNames(NodeType $nodeType)

No description

getCachingHelper()

No description

Details

void registerNodeChange(NodeInterface $node, Workspace $targetWorkspace = null)

Register a node change for a later cache flush. This method is triggered by a signal sent via ContentRepository's Node model or the Neos Publishing Service.

Parameters

NodeInterface $node

The node which has changed in some way

Workspace $targetWorkspace

An optional workspace to flush

Return Value

void

protected void addTagToFlush(string $tag, string $message = '')

No description

Parameters

string $tag
string $message

Return Value

void

protected void registerAllTagsToFlushForNodeInWorkspace(NodeInterface $node, Workspace $workspace)

No description

Parameters

NodeInterface $node
Workspace $workspace

Return Value

void

protected void resolveWorkspaceChain(Workspace $workspace)

No description

Parameters

Workspace $workspace

Return Value

void

protected void resolveTagsForChildWorkspaces(Workspace $workspace, string $startingPoint)

No description

Parameters

Workspace $workspace
string $startingPoint

Return Value

void

void registerChangeOnNodeIdentifier(string $cacheIdentifier)

Pleas use registerNodeChange() if possible. This method is a low-level api. If you do use this method make sure that $cacheIdentifier contains the workspacehash as well as the node identifier: $workspaceHash .'_'. $nodeIdentifier The workspacehash can be received via $this->getCachingHelper()->renderWorkspaceTagForContextNode($workpsacename)

Parameters

string $cacheIdentifier

Return Value

void

void registerChangeOnNodeType(string $nodeTypeName, string $referenceNodeIdentifier = null, string $nodeTypePrefix = '')

This is a low-level api. Please use registerNodeChange() if possible. Otherwise make sure that $nodeTypePrefix is set up correctly and contains the workspacehash wich can be received via $this->getCachingHelper()->renderWorkspaceTagForContextNode($workpsacename)

Parameters

string $nodeTypeName
string $referenceNodeIdentifier
string $nodeTypePrefix

Return Value

void

Exceptions

NodeTypeNotFoundException

void registerAssetChange(AssetInterface $asset)

Fetches possible usages of the asset and registers nodes that use the asset as changed.

Parameters

AssetInterface $asset

Return Value

void

Exceptions

NodeTypeNotFoundException

void shutdownObject()

No description

Return Value

void

protected void commit()

Flush caches according to the previously registered node changes.

Return Value

void

protected ContentContext getContextForReference(AssetUsageInNodeProperties $assetUsage)

No description

Parameters

AssetUsageInNodeProperties $assetUsage

Return Value

ContentContext

protected array getAllImplementedNodeTypeNames(NodeType $nodeType)

No description

Parameters

NodeType $nodeType

Return Value

array

protected CachingHelper getCachingHelper()

No description

Return Value

CachingHelper