Bug #91071
closed
Inline CSS automatically disable "Comments and whitespace" compression
Added by Timo Poppinga over 4 years ago.
Updated 4 months ago.
Description
If an CSS files in marked as inline the compression is automatically disabled this effects "comments and whitespace" and "gzip" compression.
This behevior works fine for "gzip" compression.
"Comments and whitespace" compression should not be automatically disbaled
- Related to Task #63884: Remove dependency to $this->formEngine->getIconHtml() added
- Related to deleted (Task #63884: Remove dependency to $this->formEngine->getIconHtml())
- Related to Bug #90820: CSS/JS compression problem if css is used inline added
btw: this also effects the fix of relative url paths:
TYPO3\CMS\Core\Resource\ResourceCompressor Line 356
if (!file_exists(Environment::getPublicPath() . '/' . $targetFile) || $this->createGzipped && !file_exists(Environment::getPublicPath() . '/' . $targetFile . '.gzip')) {
$contents = $this->compressCssString(file_get_contents($filenameAbsolute));
if (strpos($filename, $this->targetDirectory) === false) {
$contents = $this->cssFixRelativeUrlPaths($contents, PathUtility::dirname($filename) . '/');
}
$this->writeFileAndCompressed($targetFile, $contents);
}
return $this->returnFileReference($targetFile);
this was an side effect of compression but comes in really handy for inline css.
To fix this issue some more refactoring is necessary because TYPO3 dose not difference between gzip and whitespace compression this is done one process flow.
As well there should be an option to run cssFixRelativeUrlPaths without compression.
- Target version changed from 10 LTS to Candidate for patchlevel
- TYPO3 Version changed from 10 to 9
- Status changed from New to Closed
Following along the reason to close #75127 I would like to ask if you agree that we could close this issue, too.
Todays recommendation is to try to not rely on compression/concatenation through these TypoScript options, but either use distinct bundlers or rely on HTTP/2 multiplexing. There are several edge-case scenarios at play here, which did not really gain traction to be fixed in the many years now, so it's unlikely moving forward this would change. Especially white-space removal mentioned here (minifying) is something that bundlers can address much more safely and specifically and should maybe not be done "on-the-fly" as in the past.
I hope you can understand the reasoning of this and an team discussion about this and agree. If not, please let me know and we'll see how to proceed with this. :-)
Also available in: Atom
PDF