views:

73

answers:

2

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 JavaScript 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?

A: 

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.

cletus
+1  A: 

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
jitter