Skip to content

Commit

Permalink
Merge pull request #3 from twoldanski/bugfix/headers
Browse files Browse the repository at this point in the history
[BUGFIX] add constant header to inform what to cache on frontend side
  • Loading branch information
lukaszuznanski authored Feb 22, 2022
2 parents ff32830 + 7b83a20 commit 7dbeb61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 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
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'title' => 'Cache Purger',
'description' => 'Purge cached URLs within Varnish instances',
'category' => 'misc',
'version' => '1.0.2',
'version' => '1.0.3',
'state' => 'stable',
'clearCacheOnLoad' => 0,
'constraints' => [
Expand Down

0 comments on commit 7dbeb61

Please sign in to comment.