Skip to content

Commit

Permalink
Merge pull request #4 from andersundsehr/Lagerregal42-edit-readme-for…
Browse files Browse the repository at this point in the history
…-staticfilecache
  • Loading branch information
Kanti authored Mar 19, 2024
2 parents ba8d5e3 + fcfd57a commit 0414afc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.2' ]
php: [ '8.1', '8.2', '8.3' ]
typo3: [ '11', '12' ]
steps:
- name: Setup PHP with PECL extension
Expand Down
16 changes: 1 addition & 15 deletions Classes/Middleware/ReduceDuplicateContentMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder;

class ReduceDuplicateContentMiddleware implements MiddlewareInterface
final class ReduceDuplicateContentMiddleware implements MiddlewareInterface
{
public function __construct(private readonly ExtensionConfiguration $extensionConfiguration, private readonly PageRepository $pageRepository)
{
Expand Down Expand Up @@ -93,18 +93,4 @@ private function getStatusCode(): int
{
return (int)$this->extensionConfiguration->get('reduce_duplicate_content', 'statusCode');
}

protected function getUrlEnd(Site $site, Uri $uri): string
{
$routeEnhancers = $site->getConfiguration()['routeEnhancers'] ?? [];
foreach ($routeEnhancers as $enhancer) {
if ($enhancer['type'] !== 'PageType') {
continue;
}

return $enhancer['default'];
}

return '';
}
}
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ routeEnhancers:
try_files /typo3temp/tx_staticfilecache/https_${host}_443${uri}/index /typo3temp/tx_staticfilecache/${scheme}_${host}_${server_port}${uri}/index =405;
````

## Important! If you use staticfilecache:

If you use staticfilecache, you have to disable the fallback middleware of staticfilecache:
![image](https://github.com/andersundsehr/reduce-duplicate-content/assets/33542979/d054ea7b-8d16-4f07-b4cc-01a89be40d8e)


## Change the 307 Status Code:

You can change it in the Extension Settings.
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
],
"type": "typo3-cms-extension",
"require": {
"php": "~8.1.0 || ~8.2.0",
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"typo3/cms-core": "^11.5.11 || ^12.0"
},
"require-dev": {
Expand All @@ -21,12 +21,12 @@
},
"config": {
"allow-plugins": {
"typo3/cms-composer-installers": true,
"typo3/class-alias-loader": true,
"ergebnis/composer-normalize": true,
"phpro/grumphp": true,
"phpstan/extension-installer": true,
"pluswerk/grumphp-config": true,
"ergebnis/composer-normalize": true
"typo3/class-alias-loader": true,
"typo3/cms-composer-installers": true
}
},
"extra": {
Expand Down

0 comments on commit 0414afc

Please sign in to comment.