AfterCachedPageIsPersistedEvent
New in version 12.0
This event together with AfterCacheableContentIsGeneratedEvent has been introduced to serve as a direct replacement for the removed hook:
The PSR-14 event \TYPO3\
is commonly used to generate a static file cache. This event is only called if
the page was actually stored in TYPO3's page cache.
Example
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\Frontend\EventListener;
use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Frontend\Event\AfterCachedPageIsPersistedEvent;
#[AsEventListener(
identifier: 'my-extension/content-modifier',
)]
final readonly class MyEventListener
{
public function __invoke(AfterCachedPageIsPersistedEvent $event): void
{
// generate static file cache
}
}
New in version 13.0
The PHP attribute \TYPO3\
has been
introduced to tag a PHP class as an event listener. Alternatively, or if you
need to be compatible with older TYPO3 versions, you can also register an
event listener via the Configuration/
file. Switch to
an older version of this page for an example or have a look at the section
Implementing an event listener in your extension.
API
- class AfterCachedPageIsPersistedEvent
-
- Fully qualified name
-
\TYPO3\
CMS\ Frontend\ Event\ After Cached Page Is Persisted Event
Event that is used directly after all cached content is stored in the page cache.
NOT fired, if: A page is called from the cache Caching is disabled using 'frontend.cache.instruction' request attribute, which can be set by various middlewares or AfterCacheableContentIsGeneratedEvent