---
title: "Feature: #102628 - Cache instruction middleware"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-102628-1702031683"
source: "Changelog/13.0/Feature-102628-CacheInstructionMiddleware.rst"
modified: "2026-09-15T10:46:36+00:00"
---

# Feature: #102628 - Cache instruction middleware

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

## Description

TYPO3 v13 introduces the new frontend-related PSR-7 request attribute `frontend.cache.instruction`
implemented by class `\TYPO3\CMS\Frontend\Cache\CacheInstruction`. This replaces the
previous `TyposcriptFrontendController->no_cache` property and boolean `noCache` request
attribute.

## Impact

The attribute can be used by middlewares to disable cache mechanics of the frontend rendering.

In early middlewares before `typo3/cms-frontend/tsfe`, the attribute may or may not exist
already. A safe way to interact with it is like this:

```php
$cacheInstruction = $request->getAttribute('frontend.cache.instruction', new CacheInstruction());
$cacheInstruction->disableCache('EXT:my-extension: My-reason disables caches.');
$request = $request->withAttribute('frontend.cache.instruction', $cacheInstruction);
```

Extension with middlewares or other code after `typo3/cms-frontend/tsfe` can assume the attribute to
be set already. Usage example:

```php
$cacheInstruction = $request->getAttribute('frontend.cache.instruction');
$cacheInstruction->disableCache('EXT:my-extension: My-reason disables caches.');
```
