开发者

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

开发者 https://www.devze.com 2022-12-08 23:22 出处:网络
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

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

精彩评论

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

关注公众号