Skip to content

[4.x] Add support for brotli#43055

Merged
laoneo merged 3 commits intojoomla:4.4-devfrom
Razzo1987:patch-2
Mar 21, 2024
Merged

[4.x] Add support for brotli#43055
laoneo merged 3 commits intojoomla:4.4-devfrom
Razzo1987:patch-2

Conversation

@Razzo1987
Copy link
Contributor

@Razzo1987 Razzo1987 commented Mar 16, 2024

Add support for brotli gz compression in htaccess.txt

From Wikipedia:

Brotli is a lossless data compression algorithm developed by Google. It uses a combination of the general-purpose LZ77 lossless compression algorithm, Huffman coding and 2nd-order context modelling. Brotli is primarily used by web servers and content delivery networks to compress HTTP content, making internet websites load faster. A successor to gzip, it is supported by all major web browsers and has become increasingly popular, as it provides better compression than gzip.

Summary of Changes

Webservers that use brotli and have Joomla's htaccess enabled will fail the website in HTTPS unless you comment/delete the code block related to GZIP.
After the change, the problem no longer occurs.

Testing Instructions

  1. Check if your hosting uses brotli.
  2. Apply the patch and copy the text from htaccess.txt to .htaccess
  3. Indicate in the test whether you tested with a hosting that uses brotli or not. I think it is useful to have tests for both cases.

Actual result BEFORE applying this Pull Request

If your hosting does not use brotli

Joomla works properly

If your hosting use brotli

Joomla in HTTP works correctly.
Joomla in HTTPS does not load the CSS and JS resources, and investigating the error in the console is: ERR_CONTENT_DECODING_FAILED

Expected result AFTER applying this Pull Request

If your hosting does not use brotli

Joomla still works properly

If your hosting use brotli

Joomla works properly

NOTE

ServerPlan uses brotli.

Thanks

Thanks to ServerPlan for supporting the tests and finding the solution

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

Add support for brotli gzip compression in htaccess.txt
fix description

Co-authored-by: Brian Teeman <brian@teeman.net>
@Razzo1987 Razzo1987 changed the title Add support for brotli [4.x] Add support for brotli Mar 16, 2024
@MacJoom
Copy link
Contributor

MacJoom commented Mar 19, 2024

I have tested this item ✅ successfully on 33d2ff1

I have setup brotli compression on my own server (you need to disable gzip - and you need https!) and the change in the .htaccess fixed the issue with not loaded css and js. brotli see here: https://www.brotli.pro/enable-brotli/servers/apache/


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43055.

@Razzo1987
Copy link
Contributor Author

INFO: It seems that with ngix instead of apache the problem does not occur

@dgrammatiko
Copy link
Contributor

I have tested this item ✅ successfully on 33d2ff1


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43055.

@alikon
Copy link
Contributor

alikon commented Mar 21, 2024

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43055.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 21, 2024
@laoneo laoneo merged commit 0197d56 into joomla:4.4-dev Mar 21, 2024
@laoneo
Copy link
Member

laoneo commented Mar 21, 2024

Thanks!

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Mar 21, 2024
@laoneo laoneo added this to the Joomla! 4.4.4 milestone Mar 21, 2024
@laoneo laoneo added the bug label Mar 21, 2024
@MacJoom
Copy link
Contributor

MacJoom commented Mar 28, 2024

Hi @brianteeman - we need a Post-Installation Message for the change in the htaccess.txt - as a native speaker could you suggest a message? As we are building the RC release this evening this is urgent. Sorry for the hurry. Please ping me if you are busy. Thank you

@brianteeman
Copy link
Contributor

@MacJoom untested but should be ok - #43171

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

Comments