You’re a smart guy, figure it out!

Mike Grushin’s thoughts on everything tech-related and more…

IIS6 Compression: file extensions and testing

Posted by mikeg on April 21, 2008

See my previous post on setting up compression in IIS6 and reasons why you would want to do this

As I was doing research and thinking about what type of “extensions” I should compress, I considered the following extensions:

  • aspx
  • js
  • css
  • xml
    • above extensions were an easy decision
  • ashx
    • this was a concern because we use ASHX to generate XLS and PDF reports. I wanted to make sure that compression doesn’t break anything
    • Turns out both XLS and PDF reports were delivered successfully in the browsers I tested. The interesting thing was that they were also compressed on the server and decompressed by the browser. Fiddler reported that 552KB PDF was downloaded as 150KB. Similar compression was reported by XLS download
    • Before turning this one make sure to test all your handlers across browsers
  • asmx
    • this one was a concern because we expose our web services to a number of partners. I still have to do some more testing, but during my research I was reminded that IIS is pretty smart and it will not compress content unless the client sends “zip” header.
    • We utilize ASMX from our Flex Reporting interface by returning an XML file. The results were very impressive: 5.9MB XML file was compressed down to 454KB.
  • axd
    • These are responsible for bundled JS/CSS for ASP.NET/Ajax.ASP.NET/Telerik/etc
    • We use both Telerik and AjaxControlToolkit and when I was investigating our site in Fiddler prior to enabling compression, I noticed that some AXD were reporting as already being compressed.
    • I didn’t notice any issues/errors during testing after applying compression, so my conclusion was that IIS is smart in determining that content is already compressed and not applying compression again.
  • svc
    • this is WCF (Windows Communication Foundation) way of exposing web services
    • I decided not to include these to minimize integration issues
  • swf
    • swf is already a compressed format. you can try Zipping SWF and you will see that they don’t compress well
    • No reason to include

Above testing was done on Windows XP using IE7, FF2 and Safari3.1

This is what my IIsCompressionScheme in IIS metabase looks like:

image

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>