我正在尝试在我们的网站上使用大管道概念。这意味着尝试以块的形式发送响应,而不是整体发送响应,以便用户感觉该页面很快。我通过在 java 中的响应对象上使用flushBuffer方法成功地做到了这一点。但是现在,当我尝试使用 apache mod_deflate 模块压缩内容时,分块丢失了。
这是 apache 用于压缩内容的配置
**
DeflateBufferSize 100
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
DeflateFilterNote Input input_info
DeflateFilterNote Output output_info
DeflateFilterNote Ratio ratio_info
LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate
CustomLog /var/log/httpd/deflate_log deflate
Run Code Online (Sandbox Code Playgroud)
这是apache中打开deflate时的响应头
连接:保持活动
内容编码:gzip
内容长度:7916
内容类型:text/html;字符集 = UTF-8
日期:2012 年 1 月 27 日星期五 20:11:11 GMT
保持活动:超时 = 300,最大值 = 3997
服务器:Apache
Vary:Accept-Encoding
apache 中关闭 deflate 时的响应头
连接:保持活动
内容类型:text/html;字符集 = …