Skip to content

Commit

Permalink
[BUGFIX] add constant header to inform what to cache on frontend side
Browse files Browse the repository at this point in the history
  • Loading branch information
twoldanski committed Feb 22, 2022
1 parent ff32830 commit 43d37f1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Classes/Middleware/CacheHeaders.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
$tsfe = $GLOBALS['TSFE'] ?? null;

if ($tsfe instanceof TypoScriptFrontendController) {
if ($tsfe->isStaticCacheble()) {
$response = $response->withAddedHeader('X', 'cache');
}

$tags[] = 'T3';
$tags[] = 'PAGE-' . $tsfe->id;

$tags = implode(' ', $tags);

$response = $response->withAddedHeader('X-TYPO3-caching', $tsfe->isStaticCacheble() ? 'cache' : 'no-cache');
$response = $response->withAddedHeader('X-Tags', $tags);
}

Expand Down

0 comments on commit 43d37f1

Please sign in to comment.