---
title: "AutoClear - Hooks"
manual: "Myra Cloud Connector"
version: "4.2"
permalink: "https://docs.typo3.org/permalink/cpsit/myra-cloud-connector:auto-clear-hooks@4.2"
source: "Reference/AutoClear-Hooks.rst"
rendered: "2026-11-05T07:30:46+00:00"
---

# AutoClear - Hooks {#auto-clear-hooks}

Three AutoClear mechanisms are implemented:

-   Page update
-   File Overwrite
-   Cache tag flush

> [!NOTE]
> -   Hooks are not affected by the [Admin Only](https://docs.typo3.org/permalink/cpsit/myra-cloud-connector:admin-only@4.2) setting
> -   Hooks can be disabled via [Disable Hooks](https://docs.typo3.org/permalink/cpsit/myra-cloud-connector:disable-hooks@4.2) 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](https://docs.typo3.org/permalink/cpsit/myra-cloud-connector:clear-myra-cloud-cache-event@4.2), see
>     [Events](https://docs.typo3.org/permalink/cpsit/myra-cloud-connector:events@4.2)

## Page Update {#page-update-hook}

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](https://docs.typo3.org/permalink/cpsit/myra-cloud-connector:cache-tag-flush-hook@4.2) mechanism below.

## File Replace {#file-replace-hook}

![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 {#cache-tag-flush-hook}

<!-- TODO: no Markdown rendering for "versionadded" -->

Feature #156 - Introduce cache tag based auto-clear flush for MyraCloud

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](https://docs.typo3.org/permalink/cpsit/myra-cloud-connector:page-update-hook@4.2) 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.
