December 18th Tuesday (十二月 十八日 火曜日)

 Content filters, which process document contents within a request. These are the filters most commonly relevant to applications programming.

  Protocol filters, which deal with details of the protocol but treat the contents as opaque.  These filters are concerned
with translating between HTTP data (as defined in RFC2616) and Apache’s internal representation in the request_rec and
associated structures.

  Connection filters, which process a TCP connection without reference to HTTP (either the protocol or contents).  These
filters are concerned with interfacing Apache with the network; they operate entirely outside the scope of HTTP or of any
request_rec.

  In more detail, the output chain comprises the following stages in an enumeration util_filter.h:

AP_FTYPE_RESOURCE is for content filters. These filters are the first to see content as it is produced by the content generator,
and they serve to examine, modify, or even completely rewrite it. This is the most common form of application filter, and encompasses
markup processing (such as SSI or XML filtering), image processing, or content assembly/aggregation. Resource filters may completely
change the nature of the contents. For example, an XSLT filter might change the contents from XML to HTML or PDF.

AP_FTYPE_CONTENT_SET is a second stage of content filtering. It is intended for operations concerned with packaging the contents, such as
mod_deflate(which applies gzip compression).

AP_FTYPE_PROTOCOL is the third layer of filtering. The normal function here is to insert the HTTP headers ahead of the data emerging from
the content filters.  This is dealt with by a core filter HTTP_HEADER (function ap_http_header_filter), so applications can normally ignore
it. Apache also handles HTTP byte ranges using a protocol filter.

AP_FTYPE_TRANSCODE is for transport-level packaging. Apache implements HTTP chunking (where applicable) at this level.

AP_FTYPE_CONNECTION filters operate on connections, at the TCP level (HTTP requests no longer exist). Apache (mod_ssl) uses it for SSL encoding.
Another application is throttling and bandwidth control

AP_FTYPE_NETWORK, the final layer, deals with the connection to the client itself.  This layer is normally dealt with by Apache's
CORE output filter (function ap_core_output_filter).


 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值