Bug 64372 - mod_brotli example is a little bit evil (serving precompressed)
Summary: mod_brotli example is a little bit evil (serving precompressed)
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Documentation (show other bugs)
Version: 2.4.38
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: HTTP Server Documentation List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-23 19:06 UTC by Peter Gervai
Modified: 2020-04-23 19:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Gervai 2020-04-23 19:06:32 UTC
https://httpd.apache.org/docs/2.4/mod/mod_brotli.html

The "Serving pre-compressed content" section caused me quite a long time to resolve. I hope my failures are your way to make it better and easier for the innocent newcomers.

- The example needs "RewriteEngine On". (That really hurts.)

- There are a lot of backslahes out there. Half of them is not required at all and only confuses people. 

- REQUEST_FILENAME has a good chance not to exist; it works way better to use 
RewriteCond "%{LA-U:REQUEST_FILENAME}\.br" "-s"

- May be a bug, but unless I do
RewriteRule "^(.*)\.css$"              "$1.css.br"  [QSA,E=no-gzip:1]
all the content is double-compressed by brotli THEN gzip, and things start to break.