【问题标题】:IBM IHS 7.0 gzip compression doesn't work as expectedIBM IHS 7.0 gzip 压缩无法按预期工作
【发布时间】:2011-10-25 20:33:50
【问题描述】:

我在 IBM HTTP Server v7.0 中启用了gzip 压缩。在响应标头中,我可以将Vary 视为“accept-encoding”。 但是当我比较使用gzip 和没有gzip 加载的文件的大小时,没有区别。我不确定我是否在做 这以正确的方式。 这是我在httpd.conf 文件中添加的内容

LoadModule deflate_module modules/mod_deflate.so
AddOutputFilterByType DEFLATE text/html text/css application/x-javascript

你能帮帮我吗?

【问题讨论】:

    标签: gzip http-compression httpserver


    【解决方案1】:

    尝试以下代码并根据需要进行更改:

    LoadModule deflate_module modules/mod_deflate.so
    
    DeflateCompressionLevel 9
    DeflateMemLevel 9
    DeflateWindowSize 15
    
    DeflateFilterNote Input instream
    DeflateFilterNote Output outstream
    DeflateFilterNote Ratio ratio
    
    LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
    CustomLog logs/deflate_log deflate
    
    <Location />
        # Insert filter
          SetOutputFilter DEFLATE
    
        # Netscape 4.x has some problems...
          BrowserMatch ^Mozilla/4 gzip-only-text/html
    
        # Netscape 4.06-4.08 have some more problems
          BrowserMatch ^Mozilla/4\.0[678] no-gzip
    
        # MSIE masquerades as Netscape, but it is fine
          BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    
        # Don't compress images
          SetEnvIfNoCase Request_URI \
          \.(?:gif|jpe?g|png)$ no-gzip dont-vary
    
        # Make sure proxies don't deliver the wrong content
          Header append Vary User-Agent env=!dont-vary
    </Location> 
    

    【讨论】:

      猜你喜欢
      • 2016-09-15
      • 1970-01-01
      • 1970-01-01
      • 2018-10-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-04
      相关资源
      最近更新 更多