【问题标题】:GZip encoding - what are the potential issues (old versions of IE etc)?GZip 编码 - 有哪些潜在问题(旧版本的 IE 等)?
【发布时间】:2009-10-22 11:31:01
【问题描述】:

我隐约记得某些旧版本的某些浏览器使用 GZip 编码会做一些奇怪的事情 - 特别是我似乎记得 IE 中的一个错误导致通过 GZip 发送的 JavaScript 被破坏。

不过,模糊的回忆并没有太大的实际用途。有谁确切地知道存在什么样的问题以及它们会影响哪些用户代理?

【问题讨论】:

    标签: apache internet-explorer http iis gzip


    【解决方案1】:

    Which browsers can handle Content-Encoding: gzip

    一些常见的入门 htaccess 规则

    # 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
    

    【讨论】:

      【解决方案2】:

      基本上你需要做两件事:

      1. 确保浏览器接受 GZip 编码。有关 PHP 示例,请参阅 Supercharging Javascript, Part 2: GZip Everything
      2. 在处理安全内容时处理有缺陷的 IE 版本。见Supercharging Javascript, Part 6: The Internet Explorer Problem

      虽然这些示例是在 PHP 中,但原则是通用的。你没有说你使用的是什么语言。

      【讨论】:

        猜你喜欢
        • 2016-10-25
        • 2012-05-25
        • 2015-02-15
        • 1970-01-01
        • 2014-04-09
        • 2020-10-21
        • 2016-01-04
        • 2010-09-14
        • 1970-01-01
        相关资源
        最近更新 更多