diff --git a/public/typo3conf/ext/ep_theme/Classes/Middleware/HtmlCompress.php b/public/typo3conf/ext/ep_theme/Classes/Middleware/HtmlCompress.php deleted file mode 100644 index 80ea0b71..00000000 --- a/public/typo3conf/ext/ep_theme/Classes/Middleware/HtmlCompress.php +++ /dev/null @@ -1,54 +0,0 @@ -handle($request); - - $compressionEnabled = GeneralUtility::makeInstance(ExtensionConfiguration::class) - ->get('ep_theme', 'compressHtml'); - - if (false === (bool)$compressionEnabled || $this->isTypeNumSet($request)) { - return $response; - } - - $stream = $response->getBody(); - $stream->rewind(); - $content = $stream->getContents(); - $newBody = (new StreamFactory())->createStream($this->compressHtml($content)); - $response = $response->withBody($newBody); - - return $response; - } - - protected function compressHtml(string $html): string - { - $parser = Factory::construct(); - $html = $parser->compress($html); - $html = $this->removeComments($html); - - return $html; - } - - protected function removeComments(string $html): string - { - return preg_replace('//', '', $html); - } - - protected function isTypeNumSet(ServerRequestInterface $request): bool - { - return $request->getAttribute('routing')->getPageType() > 0; - } -} diff --git a/public/typo3conf/ext/ep_theme/Configuration/RequestMiddlewares.php b/public/typo3conf/ext/ep_theme/Configuration/RequestMiddlewares.php index 42336d11..ec4ed8b7 100644 --- a/public/typo3conf/ext/ep_theme/Configuration/RequestMiddlewares.php +++ b/public/typo3conf/ext/ep_theme/Configuration/RequestMiddlewares.php @@ -8,14 +8,5 @@ return [ 'typo3/cms-frontend/site', ], ], - 'ep/html-compress' => [ - 'target' => \EP\EpTheme\Middleware\HtmlCompress::class, - 'before' => [ - 'typo3/cms-frontend/output-compression' - ], - 'after' => [ - 'typo3/cms-adminpanel/renderer' - ], - ], ], ];