AutoClear - Hooks
Three AutoClear mechanisms are implemented:
- Page update
- File Overwrite
- Cache tag flush
Note
- Hooks are not affected by the Admin Only setting
- Hooks can be disabled via 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, see Events
Page Update
This hook listens on the
Data 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 mechanism below.
File Replace
Using the option "Replace" in FileList will trigger this hook. This also clears processed files from the cache.
Cache Tag Flush
New in version 3.3.0 / 4.1.0
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 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.