阿帕奇AddOutputFilterByType是pcated德$ P $。如何重写使用mod_filter? [英] Apache AddOutputFilterByType is deprecated. How to rewrite using mod_filter?
问题描述
<一个href=\"http://httpd.apache.org/docs/trunk/mod/mod_filter.html#addoutputfilterbytype\">AddOutputFilterByType德是precated Apache中。
AddOutputFilterByType is deprecated in Apache.
文档说相同的功能可以使用 mod_filter 。
The documentation says that the same functionality is available using mod_filter.
我目前使用
AddOutputFilterByType DEFLATE text/html
什么是相当于使用 mod_filter ?
推荐答案
AddOutputFilterByType
中有严重的局限性的httpd-2.2
所以它被打上德precated那里。但在的httpd-2.4
该指令被转移到 filter_module
,纠正和未德precated。
AddOutputFilterByType
had severe limitations in httpd-2.2
so it was marked deprecated there. But in httpd-2.4
this directive was moved to filter_module
, corrected and un-deprecated.
在Apache 2.2的您应该启用 filter_module
和 deflate_module
及用途:
In apache 2.2 you should instead enable filter_module
and deflate_module
and use:
# Declare a "gzip" filter, it should run after all internal filters like PHP or SSI
FilterDeclare gzip CONTENT_SET
# "gzip" filter can change "Content-Length", can not be used with range requests
FilterProtocol gzip change=yes;byteranges=no
# Enable "gzip" filter if "Content-Type" contains "text/html", "text/css" etc.
FilterProvider gzip DEFLATE resp=Content-Type $text/html
FilterProvider gzip DEFLATE resp=Content-Type $text/css
FilterProvider gzip DEFLATE resp=Content-Type $text/javascript
FilterProvider gzip DEFLATE resp=Content-Type $application/javascript
FilterProvider gzip DEFLATE resp=Content-Type $application/x-javascript
# Add "gzip" filter to the chain of filters
FilterChain gzip
deflate_module
只会COM pressed内容,在请求头申报的gzip
编码支持的浏览器
deflate_module
would only serve compressed content to browsers that declare support for gzip
encoding in request header.
这篇关于阿帕奇AddOutputFilterByType是pcated德$ P $。如何重写使用mod_filter?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!