httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <cove...@gmail.com>
Subject Re: [users@httpd] mod_cache, mod_deflate, mod_expires and a headache
Date Sat, 04 Jun 2016 03:28:14 GMT
On Fri, Jun 3, 2016 at 4:04 PM, Simon Mott <dementedidiot@gmail.com> wrote:
> (I don't really understand what AP_FTYPE_CONTENT_SET-2 means in the source
> for mod_expires)

I am not sure the docs capture this, but you cannot really choose an
arbitrary order with SetOutputFilter, although you can with mod_filter
(native mod_filter directives and AddOutputFilterByType -- but by-type
won't work for you because you have the issue with needing the type
set before the handler)

The reason is because each filter has a predefined type (or rank)
where it wants to run and the order in SetOutputFilter doesn't
override it, but mod_filter does indirectly override it.

Here are the values:

typedef enum {
    /** These filters are used to alter the content that is passed through
     *  them. Examples are SSI or PHP. */
    AP_FTYPE_RESOURCE     = 10,
    /** These filters are used to alter the content as a whole, but after all
     *  AP_FTYPE_RESOURCE filters are executed.  These filters should not
     *  change the content-type.  An example is deflate.  */
    AP_FTYPE_CONTENT_SET  = 20,
    /** These filters are used to handle the protocol between server and
     *  client.  Examples are HTTP and POP. */
    AP_FTYPE_PROTOCOL     = 30,
    /** These filters implement transport encodings (e.g., chunking). */
    AP_FTYPE_TRANSCODE    = 40,
    /** These filters will alter the content, but in ways that are
     *  more strongly associated with the connection.  Examples are
     *  splitting an HTTP connection into multiple requests and
     *  buffering HTTP responses across multiple requests.
     *
     *  It is important to note that these types of filters are not
     *  allowed in a sub-request. A sub-request's output can certainly
     *  be filtered by ::AP_FTYPE_RESOURCE filters, but all of the "final
     *  processing" is determined by the main request. */
    AP_FTYPE_CONNECTION  = 50,
    /** These filters don't alter the content.  They are responsible for
     *  sending/receiving data to/from the client. */
    AP_FTYPE_NETWORK     = 60
} ap_filter_type;

Filters declaring lower numbers run earlier (output from a handler
like mod_proxy/mod_cgi ->mod_include -> mod_deflate -> http filters ->
mod_ssl -> core output filter)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message