Amir Pournasserian
Amir Pournasserian

Reputation: 1674

HttpCompression in IIS7

I have written ashx which merges and remove white-spaces for javascript and css contents.
Using VS2010 ASP.NET Development Server everything works fine.

But in IIS7, text/javascript contents are not compressed (I'm using fiddler to monitor it).

I don't have problem with text/css contents and both of the contents are handled by the same ashx file.

Upvotes: 1

Views: 407

Answers (2)

Lloyd
Lloyd

Reputation: 29668

What are your compression settings in IIS? Do you have dynamic script compression enabled?

I found it much easier to implement my own filter for compression than rely on IIS.

Also, on a side note, you are aware that if you call your CSS through an ASHX file all paths in the CSS will be relative to the ASHX and not the CSS file?

Upvotes: 1

Richard
Richard

Reputation: 108975

Have you enabled dynamic content compression in IIS? (As it comes from code&lhash;an http handler—it is dynamic content.)

But, it seems to me when testing something rather similar, that IIS doesn't always compress dynamic content (sometimes fiddler showed compression, sometimes not) but it wasn't clear why (or sufficiently important for me to dig into it).

Also note, you need to ensure when using Fiddler for this you are not using the default Fiddler view/options which will decompress for display.

Upvotes: 1

Related Questions