Apache brotli enabled_CSS and JS don't load anymore

Created on 17 June 2020, over 4 years ago
Updated 20 April 2023, over 1 year ago

Hello,

I recently recognized that the CSS on my website doesn't load anymore. My investigation led me to the newly enabled brotli module that my hosting provider activated a few days ago.
There's an issue that described the problem of double compression and also provides a patch for the htaccess file which I applied. The CSS is now loaded again using drupal's default compression but when I activate AdvAgg the CSS doesn't load again (I am using the second option in AdvAgg's configuration - so not the one that is customizable in detail).

Now, I am not sure if this is a bug or not. Anyhow, I couldn't find a solution and some kind of best practice on how to use AdvAgg when brotli is enabled on the server (Apache).

I saw that AdvAgg can handle brotli. If I install brotli on my website and the .br files are sent to the server. Would the server normally compress again or how is the usual behaviour.

Does somebody know how to handle this?

🐛 Bug report
Status

Active

Version

2.34

Component

General CSS/JS

Created by

🇩🇪Germany ThuleNB

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇦🇺Australia apastorts

    Hello,

    We have exactly the same version installed in our servers and we are having the exact same issue. IT seems AdvAgg is not generating the brotli files and therefore Apache is not able to publish them.

    IS there any configuration solution for this? Or is there a path of the module or update that fixes this issue. We are loosing 10% of performance because of this issue.

  • So for anyone wondering, I was experiencing issues where upon enabling brotli the generated CSS and JS broke on our site.

    The fix for this was similar to the linked issue in the topic. Find the .htaccess files in the advagg_js and advagg_css folders and modify the rewrite rules as follows:

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

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

Production build 0.71.5 2024