lochmueller / staticfilecache

🚀 Fastest TYPO3 Extension ever 🚀
https://packagist.org/packages/lochmueller/staticfilecache
GNU General Public License v3.0
117 stars 65 forks source link

.gz conflict with compressed core files #402

Closed kraemer-igroup closed 1 year ago

kraemer-igroup commented 1 year ago

Hi there,

I noticed an issue with TYPO3 v12 and the changed file extension of compressed files from .gzip to .gz (https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Breaking-93182-ChangedFileExtensionForGzipCompressedFiles.html).

The corresponding .htaccess rules get overridden by the suggested staticfilecache configuration, which forces the type text/html for all .gz files:

<FilesMatch "\.gz$">
    ForceType text/html
    # AddType "text/html" .gz
</FilesMatch>

A solution could be, that the suggested staticfilecache configuration also provides correct file types for .js.gz and .css.gz:

<FilesMatch "\.gz$">
    ForceType text/html
    # AddType "text/html" .gz
</FilesMatch>
<FilesMatch "\.js\.gz$">
    ForceType text/javascript
    # AddType "text/javascript" .gz
</FilesMatch>
<FilesMatch "\.css\.gz$">
    ForceType text/css
    # AddType "text/css" .gz
</FilesMatch>
lochmueller commented 1 year ago

Good point... fixed with next commit.