Apache 2.4 + mod_deflate + etags = HTTP 200 Always

This Apache bug is really annoying. Fortunately, there is a really simple work-around.

Add the following to your Apache configuration:

RequestHeader  edit "If-None-Match" "^\"(.*)-gzip\"$" "\"$1\""
Header  edit "ETag" "^\"(.*[^g][^z][^i][^p])\"$" "\"$1-gzip\""

This work-around comes from comment #15 on the Bugzilla page. However, you cannot use it as is because as coded it omits the double quotes around the ETag. Credit for the correct work-around goes to this unselected answer to this Stack Overflow question.

The answer links to a bit more info about the bug.

If you would like to comment on this article, please send me an email at pennedav@gmail.com.
Feedback from comments may be incorporated in the form of updates to the article text.