Skip to content

Commit

Permalink
[4.x] Add support for brotli (#43055)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
Razzo1987 and brianteeman committed Mar 21, 2024
1 parent 3db2bf3 commit 0197d56
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions htaccess.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Options -Indexes
</IfModule>
</IfModule>

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

# Serve correct content types, and prevent mod_deflate double gzip.
RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1]
RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1]
# Serve correct content types, and prevent mod_deflate 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]

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

0 comments on commit 0197d56

Please sign in to comment.