Important: #111305 - Extbase persistence flushes caches via CacheFlusher
See forge#111305
Description
Extbase persistence now flushes the caches of persisted records through
\TYPO3\, the same service
DataHandler uses, see Feature: #111263 - Flush caches without DataHandler. The internal class
\TYPO3\ has been removed. Code that
used it to flush page caches should use
Cache with
Cache or
Cache instead.
The caches are flushed once at the end of every
Persistence, if the TypoScript setting
config. is
enabled, which is the default. Previously, the records were collected during
the request and flushed by the Extbase bootstrap after the plugin or module
had been rendered.
This changes how caches are flushed for records persisted by Extbase:
- Caches are also flushed when
persistis called outside of an Extbase plugin or module, for example in console commands or scheduler tasks. Without a request, the setting falls back to its default.All () - Page TSconfig is evaluated like for records saved in the backend:
TCEMAIN.,clear Cache_ disable TCEMAIN.andclear Cache_ page Sibling Children TCEMAIN.are respected, andclear Cache_ page Grand Parent TCEMAIN.flushes page ids andclear Cache Cmd cachecommands. The commands "pages" and "all" are never executed for records persisted by Extbase.Tag:<tag> - A persisted page record flushes the caches of the page, its siblings and its parent page instead of the caches of its parent page only.
- The PSR-14 events
\TYPO3\,CMS\ Core\ Cache\ Event\ Before Record Related Caches Are Flushed Event \TYPO3\andCMS\ Core\ Cache\ Event\ Before Cache Flush Event \TYPO3\are dispatched for records persisted by Extbase.CMS\ Core\ Cache\ Event\ After Cache Flushed Event
Records saved in the backend now also flush the cache tag
<table>_, which the automatic frontend cache tagging of
Extbase repositories (feature toggle
frontend.)
adds to lists of records of a storage page. A new record created in the
backend therefore evicts cached lists of its storage page as well.
A record moved to another page flushes the caches of its original page in addition to the caches of its new page. This applies to records moved in the backend and to objects whose "pid" is changed and persisted by Extbase, which requires a TCA column "pid" of type "passthrough".