---
title: "AutoClear - Hooks"
manual: "Myra Cloud Connector"
version: "4.1"
source: "Reference/AutoClear-Hooks.rst"
modified: "2026-09-16T08:29:39+00:00"
---

# AutoClear - Hooks

Three AutoClear mechanisms are implemented:

-   Page update
-   File Overwrite
-   Cache tag flush

> [!NOTE]
> -   Hooks are not affected by the [Admin Only](../Configuration/Typo3Features.html#admin-only) setting
> -   Hooks can be disabled via [Disable Hooks](../Configuration/Typo3Features.html#disable-hooks) setting, but this
>     only affects this extension's own hooks / event listeners, not hooks registered
>     by third-party extensions (e.g. EXT:news' data handler hook)
> -   All of them clear the cache by dispatching a
>     [ClearMyraCloudCacheEvent](Events.html#clear-myra-cloud-cache-event), see
>     [Events](Events.html#events)

## Page Update

This hook listens on the `DataHandler->clearCachePostProc` interface.

It will only clear the page itself, when the page or its elements are edited (created/updated/deleted).
It will **not** clear subpages and file resources (non-recursive).

> [!NOTE]
> When TYPO3 requests a cache tag based clear instead of a single-record
> clear (e.g. because the changed record is referenced by several pages),
> this hook forwards the request to the
> [Cache Tag Flush](#cache-tag-flush-hook) mechanism below.

## File Replace

![View of File list context menu showing Myra clear cache option](../img/context_filelist.png)

Using the option "Replace" in FileList will trigger this hook. This also
clears processed files from the cache.

## Cache Tag Flush

> [!NOTE]
> **New in version 3.3.0 / 4.1.0**
>
> [Feature #156 - Introduce cache tag based auto-clear flush for MyraCloud](https://github.com/CPS-IT/myra-cloud-connector/pull/156)

TYPO3 tags every cached page with cache tags (its own page ID, the
tables/records rendered on it, etc.) and flushes pages by tag whenever a
change makes them outdated - independently of, and often covering more
pages than, the [Page Update](#page-update-hook) hook above (e.g. when a
record is shared across several pages).

This extension registers its own cache (`myracloud`) as a member of
TYPO3's `pages` cache group. Whenever that group is flushed:

-   by cache tag, the page that was cached under that tag is cleared in Myra
    Cloud,
-   entirely (e.g. "Flush all caches"), **all** pages are cleared in Myra
    Cloud.

> [!NOTE]
> A page can only be resolved from a cache tag once it has actually been
> rendered and cached at least once. Pages that were never cached, or
> whose cache entry has already expired or been flushed, cannot be
> resolved this way.
