Asked By David Wang
01-Mar-07 10:43 PM

I really do not know if those websites are making the correct requests
to verify functionality, so I cannot comment on what you observe with
them.
I can only say that after proper configuration, make an HTTP request
for the .js resource with header "Accept-Encoding: gzip".
The response to the first request will be uncompressed. On subsequent
responses, it will be compressed with added "Content-Encoding: gzip"
header.
Web Browsers will do the above, so my test is directly comparable to
what will happen in reality.
As to whether adding .js to static compression is useful or not --
completely depends on what you want.
By default, .js is considered static file and subject to static
compression of 40-60% reduction in average bandwidth for plain text
files. It is possible to configure (intentionally or unintentionally)
for .js to be considered "dynamic" by IIS (even though it's still just
a file) and subject to dynamic compression instead.
Thus, if you are looking at "how well does .js compress", it comes
down to:
1. Did you configure the client to request compression for the
resource
2. Did you configure the server to allow compression (dynamic or
static) for the resource extension at that URL
3. Is the resource extension configured to be treated as dynamic/
static by IIS such that it is subject to dynamic/static compression
If you don't do everything correctly, you simply cannot believe the
results you observe because it will be incomplete.
//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//