gpt4 book ai didi

Apache AddOutputFilterByType 已弃用。如何使用 mod_filter 重写?

转载 作者:行者123 更新时间:2023-12-03 23:22:27 24 4
gpt4 key购买 nike

AddOutputFilterByType在 Apache 中已弃用。

文档说使用 mod_filter 可以使用相同的功能。 .

我目前使用

AddOutputFilterByType DEFLATE text/html

什么是等效使用 mod_filter ?

最佳答案

AddOutputFilterByTypehttpd-2.2 中存在严重限制所以它在那里被标记为已弃用。但在 httpd-2.4此指令已移至 filter_module ,已更正且未弃用。

在 apache 2.2 中,您应该启用 filter_moduledeflate_module并使用:

# 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只会向声明支持 gzip 的浏览器提供压缩内容请求头中的编码。

关于Apache AddOutputFilterByType 已弃用。如何使用 mod_filter 重写?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5230202/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com