Wednesday, July 31, 2013

IIS 8 Odd Compression, Is It Intended?

I just encountered odd compression behaviour in IIS 8 when I did testing for MaxLogistix. I don't know whether it's intended by the maker but I think it's not right. In IIS 7 when I enable static content compression, .css files are compressed but .js (javascript) files are not. I've read this article and still don't understand why Microsoft think that javascript is NOT static content (but css is static content, I've tried to change javacript MIME type to text/javascript but the result is same) so that I must enable dynamic content compression to make javascript files compressed in IIS. But right now in IIS 8, I'm shocked! Both of them (.css and .js) are TREATED as DYNAMIC content!

This is what I've done and I've found:
IIS version: 8

IIS 8

I added a new website
Add new site

Compression was disabled
No compression

And yes, transfer size = file size, nothing wrong
Working perfectly

Then I enabled static content compression
Enable static content compression

But still had same result, no matter how I tried to restart IIS server, restart application pool, restart site, and clear browser cache.
Static compression not working

Temporary folder used to store compressed files still empty
Empty temp folder

I tried enabling dynamic content compression
Enabling dynamic content compression

After restart IIS, restart application pool, restart site, and clear browser cache, tada... it's working!
Dynamic content compression is working

And temporary folder was as clean as before
Still empty temp folder

No comments:

Post a Comment