Closed (fixed)
Project:
Drupal core
Version:
8.9.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Apr 2018 at 18:53 UTC
Updated:
18 Dec 2019 at 16:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sk33lz commentedThis original patch applies cleanly to 8.6.x, but I can't seem to get
mod_brotliinstalled to test if this resolves the compression bug.Comment #3
mfbComment #4
mfbPatch still applies on 8.7.x branch
Comment #5
hchonovThis patch doesn't work for me. I have added the following configuration to the httpd.conf, but the only way to serve css and js is to use deflate instead brotli:
Comment #6
mfbMake sure you specify BROTLI_COMPRESS before DEFLATE, to set a preference for BROTLI.
This is what I'm using (your mileage may vary as far as which file types you want to compress):
Comment #7
achikas commentedmy provider runs ubuntu 18 with brotli compression.
this patch fixed the double compression on Drupal 8.6.2 by adding the following to the .htaccess:
# Serve correct content types, and prevent double compression.
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]
Do you think it make sense to add this patch to the core?
Comment #8
mfb@achikas if the patch above is working in your testing you could mark it RTBC
Comment #9
eglawI see a different problem here:
based on what i see the performance and CSS/JS aggregation / minification made by core Drupal system is down to 2 formats, the base css_.css and the GZipped version css_.css.gz.
If the system could create 3rd extension css_.css.br (which allows the configured web servers to server brotli compressed files too)
Comment #10
mfb@eglaw that is theoretically doable, but few people will have a brotli PHP extension installed so we may be stuck with gzip for some time.
Comment #11
mfbComment #12
yakatz commentedI have tested this patch with Apache 2.4.38 (cPanel) and this resolves my issue. Would be great to see it shipped.
Comment #14
andypostAdvagg supports brotli also it gives better compression ratio do makes sense to detect the extension and provide BC when it missing
Comment #15
alyaj2a commentedSolo puse lo que @achikas dijo, y todo funcionó! Muchas gracias.
Comment #17
yakatz commentedComment #18
alexpottWe need to update core/assets/scaffold/files/htaccess as well - this is the file used for scaffolding when you do composer create-project
Comment #19
mfbComment #20
hchonovI hope there isn't anything else missing.
Comment #21
alexpottCommitted and pushed 511b1b69df to 9.0.x and cc43ae66d7 to 8.9.x. Thanks!
As this involves changing .htaccess I don't think we should backport this to 8.8.x since I think people only really want to deal with htaccess changes on minor releases. That said this process gets a bit simpler with the new drupal scaffolding options.