]> granicus.if.org Git - apache/commitdiff
Remove duplication in Rewrite ruleset for pre-compressed content.
authorRich Bowen <rbowen@apache.org>
Sat, 2 Dec 2017 22:21:28 +0000 (22:21 +0000)
committerRich Bowen <rbowen@apache.org>
Sat, 2 Dec 2017 22:21:28 +0000 (22:21 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1816992 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/mod/mod_brotli.xml

index ece8b2eed7c50a197070ad74c12a45a4cd09fd5b..bb6e28f5bc74228370fabf7aff6e6b046c160d16 100644 (file)
@@ -142,18 +142,11 @@ content</title>
 
     <highlight language="config">
 &lt;IfModule mod_headers.c&gt;
-    # Serve brotli compressed CSS files if they exist
+    # Serve brotli compressed CSS and JS files if they exist
     # and the client accepts brotli.
     RewriteCond "%{HTTP:Accept-encoding}" "br"
     RewriteCond "%{REQUEST_FILENAME}\.br" "-s"
-    RewriteRule "^(.*)\.css"              "$1\.css\.br" [QSA]
-
-    # Serve brotli compressed JS files if they exist
-    # and the client accepts brotli.
-    RewriteCond "%{HTTP:Accept-encoding}" "br"
-    RewriteCond "%{REQUEST_FILENAME}\.br" "-s"
-    RewriteRule "^(.*)\.js"               "$1\.js\.br" [QSA]
-
+    RewriteRule "^(.*)\.(js|css)"              "$1\.$2\.br" [QSA]
 
     # Serve correct content types, and prevent double compression.
     RewriteRule "\.css\.br$" "-" [T=text/css,E=no-brotli:1]