I've a similar problem, but it happens when I use the
Content-Type response header in the predicate. In my case the predicate started to misbehave from version 28.0.0.Final, I believe. I've tested the gzip filter again in version 30.0.1.Final and the issue still persists.
After some trial-and-error, I think I've found out the cause. It looks like some (or maybe all) response headers are not available at the time a gzip filter takes action. Why do I think this? Because of the following. If I try such a simple predicate like this, based on the Content-Type response header, it doesn't work:
<filter-ref name="gzip-filter" predicate="regex (pattern='.*', value='%{o,Content-Type}', full-match=false)"/>
However, if I try the same predicate, but based on the Accept-Encoding request header, it works:
<filter-ref name="gzip-filter" predicate="regex (pattern='.*', value='%{i,Accept-Encoding}', full-match=false)"/>
The same problem happens with any other header that is returned in the response: Content-Length, Date, etc. They seem not to exist at this stage.
My next trial has been to replace the gzip filter with other filter type. Specifically, one of type response-header . The result has been the same. This makes me think that this issue affects every existing filter whose predicate uses a response header. I've not tested the max-content-size predicate, but if it reads the Content-Length header to obtain the size, I guess it might be affected too.