Events
ClearMyraCloudCacheEvent
New in version 3.3.0 / 4.1.0
Feature #155 - Introduce and use ClearMyraCloudCacheEvent for cache flush
\CPSIT\ is a PSR-14
event dispatched by every built-in trigger of a Myra Cloud cache clear
request:
- the CLI command
- the backend AJAX endpoint used by the clear-cache buttons, the clear-cache menu entries and the context menu action
- the AutoClear hooks (page update and file replace)
final class ClearMyraCloudCacheEvent
{
public function __construct(
public readonly Typo3CacheType $type,
public readonly ?string $identifier = null,
public readonly ?int $languageId = null,
) {}
public function getCacheResult(): ?bool;
public function setCacheResult(bool $result): void;
}
type
,
identifier
and
language describe what should be
cleared (see CLI command for the meaning of these values
per type). A listener is expected to report the outcome of the clear request
via
set; callers read it back via
get.
Default listener
\CPSIT\ is
registered by default. It resolves the affected page (for the page type
when no explicit language is given), forwards the request to the configured
Myra adapter, de-duplicates repeated requests for the same
identifier/language within a request via the TYPO3 runtime cache, and
reports the result back on the event.
Custom listeners
Register an additional listener on
Clear (via
# or Configuration/Services.yaml) to react to
a clear request, for example to clear an additional external cache alongside
Myra Cloud, or to log specific requests.