Asked By David Wang
04-Jul-07 06:01 PM

All you need to do is:
0. Do not pre-compress any content you want IIS to transfer with HTTP
compression
1. Make sure .js extension is processed as a static file in the vdir
that the .js file is located
2. Enable static file compression in IIS
3. Make sure .js is in the list of extensions that static file
compression applies to
4. Have client make accept-encoding: gzip,deflate request to retrieve
the .js file from the vdir
Yes, your current problem is what you describe -- the web browser
script engine only knows to deal with tetx/javascript, so the desired
sequence is NOT "plainly transport compressed entity over HTTP and
force script engine to decompress prior to execution" but rather
and send plain entity to script engine". The former is "private
communication of compressed content". The latter is "HTTP
Compression". Web browsers understand the latter, not former.
FYI: People usually have problems correctly performing steps #1 and
because it sometimes affects the distinction between "static file" and
handled by the IIS StaticFileHandler". Anything else is NOT a "static
file".
For example:
1. .txt file without application mapping and has content-type is
considered static file
2. .txt file with wildcard mapping and has content-type is considered
dynamic file
3. .asp file without application mapping and does not have content-
type is a static file that cannot be downloaded
4. .asp with application mapping and does not have content-type is a
dynamic file
People see .txt and assume #1, .asp and assume #4, but when they
customize web server processing #2 and #3 become possible... and
confusion can result. For example, substitute .log for .asp, or .xml
for .txt.
//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//