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 $tagsToFlush
protected CachingHelper $cachingHelper
protected WorkspaceRepository $workspaceRepository
protected array $workspacesToFlush
protected AssetService $assetService
protected NodeTypeManager $nodeTypeManager
protected ContentContextFactory $contextFactory
protected PersistenceManagerInterface $persistenceManager
protected ContentContext[] $contexts
protected Context $securityContext

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
void
resolveWorkspaceChain(Workspace $workspace)

No description

void
resolveTagsForChildWorkspaces(Workspace $workspace, string $startingPoint)

No description

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)

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()

Flush caches according to the previously registered node changes.

string[]
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

Exceptions

NodeTypeNotFoundException

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

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

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

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()

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 string[] getAllImplementedNodeTypeNames(NodeType $nodeType)

No description

Parameters

NodeType $nodeType

Return Value

string[]

protected CachingHelper getCachingHelper()

No description

Return Value

CachingHelper