Skip to content

Commit 0197d56

Browse files
[4.x] Add support for brotli (#43055)
* Add support for brotli Add support for brotli gzip compression in htaccess.txt * fix description fix description Co-authored-by: Brian Teeman <[email protected]> --------- Co-authored-by: Brian Teeman <[email protected]>
1 parent 3db2bf3 commit 0197d56

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

htaccess.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Options -Indexes
136136
</IfModule>
137137
</IfModule>
138138

139-
## GZIP
139+
## GZIP & BROTLI
140140
## These directives are only enabled if the Apache mod_headers module is enabled.
141141
## This section will check if a .gz file exists and if so will stream it
142142
## directly or fallback to gzip any asset on the fly
@@ -157,9 +157,9 @@ Options -Indexes
157157
RewriteCond "%{REQUEST_FILENAME}\.gz" -s
158158
RewriteRule "^(.*)\.js" "$1\.js\.gz" [QSA]
159159

160-
# Serve correct content types, and prevent mod_deflate double gzip.
161-
RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1]
162-
RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1]
160+
# Serve correct content types, and prevent mod_deflate double compression.
161+
RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1,E=no-brotli:1]
162+
RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1,E=no-brotli:1]
163163

164164
<FilesMatch "(\.js\.gz|\.css\.gz)$">
165165
# Serve correct encoding type.

0 commit comments

Comments
 (0)