The Filter Chain is available in Apache 2.0 and higher,
and enables applications to process incoming and outgoing data
in a highly flexible and configurable manner, regardless of
where the data comes from. We can pre-process incoming data,
and post-process outgoing data, at will. This is basically
independent of the traditional request processing phases.

mod_filter, included in Apache 2.1 and later,
enables the filter chain to be configured dynamically at run time.
So for example you can set up a proxy to rewrite
HTML with an HTML filter and JPEG images with a completely
separate filter, despite the proxy having no prior information
about what the origin server will send. This works by using a
filter harness, that dispatches to different providers according
to the actual contents at runtime. Any filter may be either
inserted directly in the chain and run unconditionally, or
used as a provider and inserted dynamically. For example,

an HTML processing filter will only run if the content is
text/html or application/xhtml+xml

A compression filter will only run if the input is a
compressible type and not already compressed

A charset conversion filter will be inserted if a text
document is not already in the desired charset

There are two ways to use filtering: Simple and Dynamic.
In general, you should use one or the other; mixing them can
have unexpected consequences (although simple Input filtering
can be mixed freely with either simple or dynamic Output filtering).

Notice:This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.