Skip to content

Commit

Permalink
Check correct modules before directives
Browse files Browse the repository at this point in the history
Fixes #291
  • Loading branch information
LeoColomb committed Feb 13, 2022
1 parent 7956cbc commit cb8ef1b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
14 changes: 9 additions & 5 deletions h5bp/web_performance/pre-compressed_content_brotli.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
# https://httpd.apache.org/docs/current/mod/mod_brotli.html#precompressed

<IfModule mod_headers.c>
<IfModule mod_rewrite.c>

RewriteCond %{HTTP:Accept-Encoding} br
RewriteCond %{REQUEST_FILENAME}\.br -f
Expand Down Expand Up @@ -47,12 +47,16 @@
.json.br
</IfModule>

# Force proxies to cache brotlied and non-brotlied files separately
Header append Vary Accept-Encoding
<IfModule mod_headers.c>
# Force proxies to cache brotlied and non-brotlied files separately
Header append Vary Accept-Encoding
</IfModule>

</FilesMatch>

# Serve correct encoding type
AddEncoding br .br
<IfModule mod_mime.c>
# Serve correct encoding type
AddEncoding br .br
</IfModule>

</IfModule>
15 changes: 9 additions & 6 deletions h5bp/web_performance/pre-compressed_content_gzip.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# keep the default behavior regarding .gz files.
# https://httpd.apache.org/docs/current/mod/mod_mime.html#removetype

<IfModule mod_headers.c>
<IfModule mod_rewrite.c>

RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -f
Expand All @@ -27,7 +27,6 @@

<FilesMatch "\.gz$">

# Serve correct content types
<IfModule mod_mime.c>
# (1)
RemoveType gz
Expand All @@ -47,12 +46,16 @@
.json.gz
</IfModule>

# Force proxies to cache gzipped and non-gzipped files separately
Header append Vary Accept-Encoding
<IfModule mod_headers.c>
# Force proxies to cache gzipped and non-gzipped files separately
Header append Vary Accept-Encoding
</IfModule>

</FilesMatch>

# Serve correct encoding type
AddEncoding gzip .gz
<IfModule mod_mime.c>
# Serve correct encoding type
AddEncoding gzip .gz
</IfModule>

</IfModule>

0 comments on commit cb8ef1b

Please sign in to comment.