From: Nick Kew Date: Mon, 1 Nov 2004 10:13:35 +0000 (+0000) Subject: Fix typo and update HTML version. X-Git-Tag: 2.1.1~83 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=465fc26a9d50b11ba026103b829cb9b39c92b19e;p=apache Fix typo and update HTML version. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105649 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/mod_filter.html.en b/docs/manual/mod/mod_filter.html.en index 7b2491db7b..72da72739b 100644 --- a/docs/manual/mod/mod_filter.html.en +++ b/docs/manual/mod/mod_filter.html.en @@ -1,21 +1,21 @@ - mod_filter - Apache HTTP Server - - - - + + + + -
<-
+ +
<-
Apache > HTTP Server > Documentation > Version 2.1 > Modules
@@ -44,23 +44,23 @@

Directives

Topics

-
top
+
top
-

Smart Filtering

+

Smart Filtering

In the traditional filtering model, filters are inserted unconditionally using AddOutputFilter and family. Each filter then needs to determine whether to run, and there is little @@ -76,9 +76,9 @@ content generator. The ability to dispatch based on Environment Variables offers the full flexibility of configuration with mod_rewrite to anyone who needs it.

-
top
+
top
-

Filter Declarations, Providers and Chains

+

Filter Declarations, Providers and Chains

[This image displays the traditional filter model]
Figure 1: The traditional filter model

@@ -106,25 +106,30 @@ harness, each of which may have any number of providers. A special case is that of a single provider with unconditional dispatch: this is equivalent to inserting the provider filter directly into the chain.

-
top
+
top
-

Configuring the Chain

+

Configuring the Chain

There are three stages to configuring a filter chain with mod_filter. For details of the directives, see below.

Declare Filters
The FilterDeclare directive - declares a filter, assigning it a name and a dispatch criterion.
+ declares a filter, assigning it a name and filter type. Required + only if the filter is not the default type AP_FTYPE_RESOURCE.
Register Providers
The FilterProvider - directive registers a provider with a filter. The filter must have - been registered with FilterDeclare. The provider must have been + directive registers a provider with a filter. The filter may have + been registered with FilterDeclare; if not, FilterProvider will implicitly + declare it with the default type AP_FTYPE_RESOURCE. The provider + must have been registered with ap_register_output_filter by some module. - The final argument to FilterProvider is a match string, that will be checked - against the filter's dispatch criterion to determine whether to run - this provider.
+ The remaining arguments to FilterProvider are a dispatch criterion and a match string. + The former may be an HTTP request or response header, an environment + variable, or the Handler used by this request. The latter is matched + to it for each request, to determine whether this provider will be + used to implement the filter for this request.
Configure the Chain
The above directives build components of a smart filter chain, @@ -132,16 +137,16 @@ filters declared, offering the flexibility to insert filters at the beginning or end of the chain, remove a filter, or clear the chain.
-
top
+
top
-

Examples

+

Examples

Server side Includes (SSI)
A simple case of using mod_filter in place of AddOutputFilterByType

- FilterDeclare SSI Content-Type
- FilterProvider SSI INCLUDES $text/html
+ FilterDeclare SSI
+ FilterProvider SSI INCLUDES resp=Content-Type $text/html
FilterChain SSI

@@ -150,18 +155,17 @@
The same as the above but dispatching on handler (classic SSI behaviour; .shtml files get processed).

- FilterDeclare SSI Handler
- FilterProvider SSI INCLUDES server-parsed
+ FilterProvider SSI INCLUDES Handler server-parsed
FilterChain SSI

Emulating mod_gzip with mod_deflate
Insert INFLATE filter only if "gzip" is NOT in the - Accept-Encoding header. + Accept-Encoding header. This filter runs with ftype CONTENT_SET.

- FilterDeclare gzip req=Accept-Encoding
- FilterProvider gzip inflate !$gzip
+ FilterDeclare gzip CONTENT_SET
+ FilterProvider gzip inflate req=Accept-Encoding !$gzip
FilterChain gzip

@@ -170,19 +174,16 @@
Suppose we want to downsample all web images, and have filters for GIF, JPEG and PNG.

- FilterDeclare unpack Content-Type
- FilterProvider unpack jpeg_unpack $image/jpeg
- FilterProvider unpack gif_unpack $image/gif
- FilterProvider unpack png_unpack $image/png
+ FilterProvider unpack jpeg_unpack Content-Type $image/jpeg
+ FilterProvider unpack gif_unpack Content-Type $image/gif
+ FilterProvider unpack png_unpack Content-Type $image/png

- FilterDeclare downsample Content-Type
- FilterProvider downsample downsample_filter $image
+ FilterProvider downsample downsample_filter Content-Type $image
FilterProtocol downsample "change=yes"

- FilterDeclare repack Content-Type
- FilterProvider repack jpeg_pack $image/jpeg
- FilterProvider repack gif_pack $image/gif
- FilterProvider repack png_pack $image/png
+ FilterProvider repack jpeg_pack Content-Type $image/jpeg
+ FilterProvider repack gif_pack Content-Type $image/gif
+ FilterProvider repack png_pack Content-Type $image/png
<Location /image-filter>
FilterChain unpack downsample repack
@@ -191,9 +192,9 @@

-
top
+
top
-

Protocol Handling

+

Protocol Handling

Historically, each filter is responsible for ensuring that whatever changes it makes are correctly represented in the HTTP response headers, and that it does not run when it would make an illegal change. This @@ -225,8 +226,8 @@ default (i.e. in the absence of any FilterProtocol directives), mod_filter will leave the headers untouched.

-
top
-

FilterChain Directive

+
top
+

FilterChain Directive

@@ -261,12 +262,11 @@ -
top
-
Description:Configure the filter chain
Syntax:FilterChain [+=-@!]filter-name ...
- + @@ -279,14 +279,6 @@ FilterChain and FilterProtocol directives.

-

The second is a string with optional req=, - resp= or env= prefix causing it - to dispatch on (respectively) the request header, response - header, or environment variable named. In the absence of a - prefix, it defaults to a response header. A special case is the - word handler, which causes mod_filter - to dispatch on the content handler.

-

The final (optional) argument is the type of filter, and takes values of ap_filter_type - namely RESOURCE (the default), CONTENT_SET, @@ -294,8 +286,8 @@ or NETWORK.

-
top
-
Description:Declare a smart filter
Syntax:FilterDeclare filter-name [req|resp|env]=dispatch - [type]
Syntax:FilterDeclare filter-name [type]
Context:server config, virtual host, directory, .htaccess
Override:Options
Status:Experimental
Description:Deal with correct HTTP protocol handling
Syntax:FilterProtocol filter-name [provider-name] @@ -343,12 +335,12 @@ -
top
-

FilterProvider Directive

+
top
+

FilterProvider Directive

+ [req|resp|env]=dispatchmatch @@ -357,14 +349,22 @@

This directive registers a provider for the smart filter. The provider will be called if and only if the match declared here matches the value of the header or environment variable declared - as dispatch in the FilterDeclare directive that declared - filter-name.

+ as dispatch.

-

filter-name must have been declared with - FilterDeclare. +

provider-name must have been registered by loading a module that registers the name with - ap_register_output_filter.

+ ap_register_output_filter. + +

+ +

The dispatch argument is a string with optional + req=, resp= or env= prefix + causing it to dispatch on (respectively) the request header, response + header, or environment variable named. In the absence of a + prefix, it defaults to a response header. A special case is the + word handler, which causes mod_filter + to dispatch on the content handler.

The match argument specifies a match that will be applied to the filter's dispatch criterion. The match may be @@ -382,7 +382,7 @@

Description:Register a content filter
Syntax:FilterProvider filter-name provider-name - match
Context:server config, virtual host, directory, .htaccess
Override:Options
Status:Experimental
- + @@ -392,8 +392,8 @@
CharacterDescription
(none)exact match
$substring match
/regexp match
/regexp match (delimited by a second /
=integer equality
<integer less-than
<=integer less-than or equal
-
top
-

FilterTrace Directive

+
top
+

FilterTrace Directive

@@ -416,7 +416,7 @@
mod_filter will record buckets and brigades passing through the filter to the error log, before the provider has processed them. This is similar to the information generated by - mod_diagnostics. + mod_diagnostics.
2 (not yet implemented)
@@ -432,4 +432,4 @@ - \ No newline at end of file + diff --git a/docs/manual/mod/mod_filter.xml b/docs/manual/mod/mod_filter.xml index f5b10fac50..328d5143f6 100644 --- a/docs/manual/mod/mod_filter.xml +++ b/docs/manual/mod/mod_filter.xml @@ -1,7 +1,7 @@ - +
Description:Get debug/diagnostic information from mod_filter