Changes to compression in IIS7

Posted: Jun 13, 2006  34 comments  

Average Rating


Share this Post

Compression module provides IIS the capability to serve compressed responses to compression enabled clients. Clients which can accept compressed responses send Accept-Encoding header indicating compression schemes they can handle. If IIS can compress the response using a compression scheme which client can understand, IIS will send a compressed response with Content-Encoding response header indicating the scheme which was used to compress the response. Read more ...

View the original post



This is nice to know, for IIS7 about the compression. But I have one question for this, if you could provide me an answer that would be greate, and I really appriciate that.

i tried to use http compresion on IIS7, but somehow, i guess that dose not give me any result.

I tried to access my website using the folllwing webtools.

which always shows me, Compression Status : notcompress [:(]

So, i guess something more we need to do httpCompression in IIS7.

Please look into the following what i wrote in my web.config file.


<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">


               <add mimeType="text/*" enabled="true" />

               <add mimeType="message/*" enabled="true" />

               <add mimeType="application/x-javascript" enabled="true" />

               <add mimeType="*/*" enabled="true" />


           <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />



           <add name="URLRewriter" type="ILink.Beonit.HTTPModules.URLRewriter, ILink.Beonit.HttpModules.URLRewriter" preCondition="managedHandler" />

           <add name="Authentication" type="ILink.Beonit.HTTPModules.Authentication, ILink.Beonit.HttpModules.Authentication" preCondition="managedHandler" />

           <add name="ModuleRewriter" type="ILink.Beonit.HTTPModules.ModuleRewriter,ILink.Beonit.HTTPModules.URLRewriter" preCondition="managedHandler" />

           <add name="ImageServer" type="ILink.Beonit.HTTPModules.ImageServer, ILink.Beonit.HttpModules.ImageServer" preCondition="managedHandler" />



           <add name="ajax/*.ashx_POST,GET" path="ajax/*.ashx" verb="POST,GET" type="Ajax.PageHandlerFactory, Ajax" preCondition="integratedMode,runtimeVersionv2.0" />


       <validation validateIntegratedModeConfiguration="false" />

       <httpRedirect enabled="false" destination="" />

       <urlCompression doDynamicCompression="true">



I am awaiting for your reply

Jun 20 2007 by Chintan Parmar


Are you sure you wrote httpCompression section properties in web.config? HttpCompression section is defined AppHostOnly in applicationHost.config which prevents you from setting its properties in web.config. Compression module only reads server level properties from applicationHost.config. If you allowed httpCompression section by modifying section definition in applicationHost.config, that might be a problem. See if this is the problem.


Jun 24 2007 by ksingla

When you say "the main thread", do you mean a request thread, or the main IIS service thread?

One compression thread per app pool, or many?

Aug 02 2007 by Vlad


By main thread, I meant request thread. There is no dedicated thread to do compression in IIS7 and so there can be many threads in a worker process doing compression.


Aug 02 2007 by ksingla

Thank you very much for the information, it is very helpful to understand how much it has changed from IIS 6.0!

Aug 03 2007 by Vlad

Javascript won't work on a webpage in iis7 ?

Nov 09 2007 by mike

I think that removing the various knobs is a mistake. Setting a good default value and leaving the knobs available would be my preference.

As for:

HcPriority is removed as scheme to use when multiple ones appear in Accept-Encoding header of request is picked depending on scheme which is appear first in Accept-Encoding header (assuming no q factor). This is as per HTTP specs.

It may be true that the client can specify a preference, and the preference is in presentation order, but, the server administrator may have a different preference. That is why it is stated as a preference order. And yes, there are good reasons for picking one over the other in specific circumstances.

Nov 11 2007 by spenser

In IIS6, I can add *.jsp as a file type for dynamic content compression.

For IIS7, I do not need to worry about the file type for dynamic, thery are all enabled, right?


Nov 24 2007 by George


In IIS7, you can enable/disable compression based on mime-types. So instead of adding *.jsp, you need to enable dynamic compression for its mime-type by editing configuration in system.webServer/httpCompression section under dynamicTypes element. If you want to enable dynamic compression for all mime types, you can allow dynamic compression for */* mime-type. By default, dynamic compression is enabled for text/* and message/* mimetypes and not for all (mime-type */* has enabled="false").


Nov 27 2007 by ksingla


I am not sure why you think that javascript won't work on a webpage in IIS7. Javascript will work just fine on IIS7. Javascript is just another file and we send it across on http. Its http clients responsibility to request the files and interpret them all correctly.


Nov 27 2007 by ksingla


Other than HcPriority and HcFilesDeletedPerDiskFree , other knobs were deleted because they pretty much don't make any sense given the design changes. I agree than scheme priority can be useful in some cases but we choose to stay compliant with http specs instead.


Nov 27 2007 by ksingla

Astroloji, günlük burçlar, burç uyumları, yükselen burçlar, aşk ölçer, haftalık burçlar, aylık burçlar, aşk falı testi, burç uyumu.

Dec 11 2007 by burçlar


Jan 10 2008 by carsamba

Javascript won't work on a webpage in iis7 ?

Jan 10 2008 by carsamba

Hi carsamba,

Javascript will work perfectly in IIS7. I am not sure why you got the impression that javascript won't work.


Jan 10 2008 by ksingla

hi ;

We have a very busy server and IIS Compression disables mostly in daytime. We want it to be open what ever it costs. Because of not being want to consuma that much bandwith.

We even did make

dynamicCompressionDisableCpuUsage="99"                                  dynamicCompressionEnableCpuUsage="1">

But how can I complettly shut of the disabling system ?

Thank you very much

Aug 10 2008 by gunok

Hi gunok,

There is no separate knob to completely shutoff the disabling system. If you change dynamicCompressionDisableCpuUsage and staticCompressionDisableCpuUsage to 100, that will effectively turn this system off because cpu usage will never be more than 100%. I don't think you need to set dynamicCompressionEnableCpuUsage and staticCompressionEnableCpuUsage but you can set them to 99/100 telling the system to enable it back if usage falls below 99%/100%.



Aug 19 2008 by ksingla

Have you seen an situation where event ID 2264 is logged hourly?

"The directory specified for caching compressed content C:\inetpub\temp\IIS Temporary Compressed Files\DefaultAppPool is invalid.  Static compression is being disabled"

can you explain how this might be related to any changes in IIS7?

Sep 13 2008 by Anonymous


I read that IIS6 does not support inbound HTTP compression. Is is true and is there a chance that inbound compression is supported by IIS7?

Best regards,

Yves Van Dooren.

Oct 22 2008 by Anonymous

Hi Yves Van Dooren,

Yes, its true that IIS6 doesn't support inbound http compression and same is true for IIS7. I am not aware of any plans to support that in next release as well. I will follow-up on this request in the team so that we can evaluate doing this in a future release.



Oct 23 2008 by ksingla


Is it reasonable to hope for whitespace compression and normalization (i.e. minify in new releases of iis? There is 3rd party software that can do this through ISAPI filters for IIS5/6.

We've been 10-15% improvements in bandwidth from minifying on our clusters.


Nov 06 2008 by elk5432

Hi Eugene,

Right now this is not planned for next release of IIS7. I am going to follow up in the team and see if we should do something similar in compression module. I will reply again when there is a decision on this.

Thanks for suggesting this feature.


Dec 09 2008 by ksingla

Thanks for this fresh information; I was looking for a convenient place for compressing heavy video file. Besides these, I have found another place to compress and decompress all sorts of files. That is where you can zip or unzip ten files online altogether.

Feb 11 2009 by Anonymous

Thanks for this fresh information; I was looking for a convenient place for compressing heavy video file. Besides these, I have found another place to compress and decompress all sorts of files. That is where you can zip or unzip ten files online altogether.

Feb 12 2009 by Anonymous

I think what people are getting at when they say it doesn't work with Javascript is that by default the applicationHost.config has the following line in the static HTMLCompression section:

<add mimeType="application/javascript" enabled="true" />

However in the same document IIS is configured to give .js files to the mimeType "application/x-javascript", so js files will not be zipped by default. Adding the following line gets it all working.

<add mimeType="application/x-javascript" enabled="true" />

Hope this saves someone else a little time

Feb 16 2009 by Anonymous

A Better HTTP Compression Solution

Here is a better solution that works with JavaScript and also compatible and with AJAX enabled content:

This HTTP Compression module uses configureable MIME types and other features that are not being offered by any other http compression software, it is also being configured through the Web.config and not on IIS,

See how flexible it can be:

Feb 18 2009 by Anonymous

Hi Avinash,

By “you don’t have access to IIS”, I understand you don’t have administrator access to IIS and can only change configuration in web.config. Is this correct?

If yes, then no you can’t enable compression for “.config” files. Only administrator can enable compression for “.config” files by adding that to httpCompression/staticTypes list. You can only control if you want to enable or disable compression completely by setting urlCompression/doStaticCompression property.



May 06 2009 by ksingla

A stupid question perhaps, but hasn't compression always been a part of the http standard (1.1).

"The web client includes an Accept-Encoding field in the HTTP request, with supported compression schema names (called content-coding tokens), separated by commas.

GET /encrypted-area HTTP/1.1


Accept-Encoding: gzip, deflate"

I mean, if the client tells the webserver it supports gzip compression then the webserver is free to (and should if it can) compress the traffic using gzip. Is this not automagically supported by the CF framework, and has this not been supported by IIS until IIS7 or what?




Sep 26 2010 by kfransson

Submit a Comment

  • Plain text is accepted.
  • URLs starting with http:// are converted to links.