---
title: "Feature: #96879 - New PSR-14 event ModifyCacheLifetimeForPageEvent"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-96879-1663513042"
source: "Changelog/12.0/Feature-96879-NewPSR-14EventModifyCacheLifetimeForPageEvent.rst"
typo3-version: "12.0"
typo3-major: 12
type: "feature"
issue: 96879
forge: "https://forge.typo3.org/issues/96879"
tags: ["Frontend", "PHP-API", "ext:frontend"]
rendered: "2026-09-20T18:31:11+00:00"
---

# Feature: #96879 - New PSR-14 event ModifyCacheLifetimeForPageEvent {#feature-96879-1663513042}

See [forge#96879](https://forge.typo3.org/issues/96879)

## Description {#description}

A new PSR-14 event `ModifyCacheLifetimeForPageEvent` has been introduced.
This event serves as a successor for the
`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['get_cache_timeout']`
hook.

## Impact {#impact}

The new event allows to modify the lifetime how long a rendered page of a
frontend call should be stored in the "pages" cache.

Common registration and usage for a listener:

```yaml
services:
  MyCompany\MyPackage\EventListener\ChangeCacheTimeout:
    tags:
      - name: event.listener
        identifier: 'mycompany/mypackage/cache-timeout'
```

```php
<?php

namespace MyCompany\MyPackage\EventListener;

class ChangeCacheTimeout
{
    public function __invoke(ModifyCacheLifetimeForPageEvent $event): void
    {
        // Only cache all pages for 30 seconds when in development context
        if (Environment::getContext()->isDevelopment()) {
            $event->setCacheLifetime(30);
        }
    }
}
```
