Support

Admin Tools

#40592 Joomla 4.4.4, Admin tools and Brotli Compression

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
4.4.4
PHP version
8.1.28
Admin Tools version
7.5.1

Latest post by pscarnegie on Wednesday, 17 April 2024 08:37 CDT

pscarnegie

I've got a question about Admin Tools and the latest Joomla 4.4.4 update. After the update, there's a new post installation message that says the following:

 

Before 4.4.4 the default htaccess.txt did not support Brotli compression. This could result in double compression errors when Joomla is installed on a server that uses Brotli compression. You should manually apply the necessary changes to any existing .htaccess file, as this file can not be updated automatically.

The old code:

RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1]
RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1]

The new code:

RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1,E=no-brotli:1]
RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1,E=no-brotli:1]

 

Assuming I make any other admin tweeks and save, won't Admin Tools overwrite what I've manually edited? I'm not currently seeing any issues on the front end with respect to the current .htaccess file and J4.4.4, but I need to get some clarity on what all is going on here before I update any of my other Joomla sites to 4.4.4

Thank you.

nicholas
Akeeba Staff
Manager

TL;DR: Don't worry. The problem affected very few sites, and Admin Tools' .htaccess Maker made sure you're not affected anyway.

If you want more detail, read on.

First of all, this issue would only happen if you were hosting your site on a server which has both mod_deflate and mod_brotli Apache modules enabled, and your browser requests GZip content with a higher priority than Brotli. The former is extremely unlikely on commercial hosting. The latter, I have not seen in any commercial browser released the last 5 years. So, it's a mostly theoretical issue.

Regardless, Admin Tools was already working around this problem the past 2-odd years this feature has been available in Joomla. We included code which stopped automatic GZip and Brotli compression on .css.gz, .js.gz, .css.br, and .js.br files because we had spotted the problem.

Finally, an aside. Joomla's recommended code is wrong. It works in the default .htaccess file shipped with Joomla only because there are no more RewriteRule lines at the end. If you were to add other RewriteRule lines it would break your site unless you also add the L flag in those RewriteRule lines, i.e.

RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1,E=no-brotli:1,L]
RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1,E=no-brotli:1,L]

Now you know :)

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

pscarnegie

You, fine Sir, are a rock star. And as an aside, probably the best third party Joomla developer out there! Keep up the great work and awesome support.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!