IBM IHS 7.0 gzip 压缩无法按预期工作

发布于 2024-12-12 07:17:47 字数 420 浏览 0 评论 0原文

我已在 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

您能帮帮我吗?

I've enabled gzip compression in my IBM HTTP Server v7.0. In the response header I can see Vary as "accept-encoding".
But when I compare the size of the file that was loaded with gzip and without gzip there is no difference. I'm not sure if I'm doing
this in the correct way.
This is what I added in the httpd.conf file

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

Can you please help me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

双手揣兜 2024-12-19 07:17:47

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

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> 

Try the following code and change it as you would like:

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> 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文