开发者

GZip encoding - what are the potential issues (old versions of IE etc)?

I can vaguely remember that there are certain older versions of certain browsers that do weird things with GZip encoding - in particular I seem to recall a bug in IE which resulted in JavaS开发者_JAVA技巧cript sent over GZip getting mangled.

Vague recollections aren't much practical use though. Does anyone know exactly what kind of issues there are and which user agents they affect?


Which browsers can handle Content-Encoding: gzip

Some common htaccess rules for a starter

# 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


Basically there are two things you need to do:

  1. Ensure the browser accepts GZip encoding. See Supercharging Javascript, Part 2: GZip Everything for a PHP example and
  2. Handle buggy versions of IE when dealing with secure content. See Supercharging Javascript, Part 6: The Internet Explorer Problem.

Although these examples are in PHP the principles are universal. You don't say what language you're using.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜