-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Christoph Lehmann
committed
Jan 12, 2023
0 parents
commit b977ead
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Networkteam\CacheBase\Hooks; | ||
|
||
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; | ||
|
||
class CreateHashBaseHook | ||
{ | ||
public function addVariables($params, TypoScriptFrontendController $typoScriptFrontendController) | ||
{ | ||
$params['hashParameters']['networkteam_cachebase'] = $GLOBALS['EXTCONF']['networkteam_cachebase']['keys']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# TYPO3 Extension networkteam_cachebase | ||
|
||
In container environments with rolling updates there is the point where two versions run parallel and a page cache flush | ||
is not what we want. | ||
|
||
## What does it do? | ||
|
||
This extension adds variables to the page cache identifier calculation. For our Use Case it adds the | ||
environment variable `SENTRY_RELEASE`, which contains a version number. | ||
|
||
More variables can be added like | ||
|
||
```php | ||
$GLOBALS['EXTCONF']['networkteam_cachebase']['keys']['your_key'] = 'value'; | ||
``` | ||
|
||
## Installation | ||
|
||
```shell | ||
composer req networkteam/typo3-cachebase | ||
``` | ||
|
||
## Background | ||
|
||
The page cache hash calculation is based on | ||
|
||
* Page row | ||
* TypoScript Conditions | ||
* Modification time of loaded TypoScript files | ||
* Site | ||
* ... and some more | ||
|
||
but changes for example in Fluid Templates are not taken into account. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "networkteam/typo3-cachebase", | ||
"type": "typo3-cms-extension", | ||
"description": "It adds variables to the page cache identifier calculation for serving multiple versions of a webseite parallel. This is the case in container environments with rolling updates.", | ||
"license": "GPL-2.0-or-later", | ||
"keywords": [ | ||
"caching", | ||
"container" | ||
], | ||
"authors": [ | ||
{ | ||
"name": "networkteam", | ||
"email": "typo3@networkteam.com" | ||
} | ||
], | ||
"autoload": { | ||
"psr-4": { | ||
"Networkteam\\CacheBase\\": "Classes/" | ||
} | ||
}, | ||
"require": { | ||
"typo3/cms-core": "^11.5 || ^12.0" | ||
}, | ||
"extra": { | ||
"typo3/cms": { | ||
"extension-key": "networkteam_cachebase" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
|
||
$GLOBALS['EXTCONF']['networkteam_cachebase']['keys']['sentry_release'] = getenv('SENTRY_RELEASE'); | ||
|
||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['createHashBase'][] | ||
= \Networkteam\CacheBase\Hooks\CreateHashBaseHook::class . '->addVariables'; |