2

I have a web service returning an XML value in a String format.

Through IE9, I can see that some of the size for the web service calls go as high as 1MB.

I enabled compression in IIS 6 by editing the Metabase.xml file, setting the following:

HcScriptFileExtensions = "asmx"

under the

IIsCompressionScheme    Location ="/LM/W3SVC/Filters/Compression/gzip"

I have also enabled HTTP Compression on the Service tab for the Web Sites properties in IIS Manager.

I have also added the HttCompression in the web service extensions, mapping to the gzip dll on the Windows\System32\inetsrv\ folder.

When I make the call to the web service, the value being returned is not compressed (the same size as with the service call before).

Any tips to ensure that IIS compresses the string data value being returned by IIS?

Update: I also followed the instructions on these links:

http://rextang.net/blogs/work/archive/2007/09/12/5654.aspx http://blogs.msdn.com/b/rextang/archive/2007/09/13/4880187.aspx

Using IE9, I from the Developer Tools, checking the detailed view of the web service call, I can see that the Accept-Encoding key has a value of gzip/deflate.

The web service SOAP XML (in String) value is still not being compressed. Any areas where I should be looking further?

By the way, I am using IIS6.

Update: I checked this site: http://blogs.iis.net/webtopics/archive/2009/02/24/troubleshooting-http-compression-in-iis-6-0.aspx

I got items 1,2,3 properly.

For item 4, I even tried only setting asmx as extension but to no avail.

For item 5, I don't have any compression setting at a child level.

For item 6, the antivirus does not make a scan on the directory for compression.

For item 7, I am passing no slash as parameter on the executing DLL.

For item 8, I am unsure where/how to check for this.

For item 9, I have checked with fiddler and the proper headers are being placed on the request headers.

For item 10, I don't see any settings in my apps that would require touching this.

For item 11, status code I am receiving is 200.

For item 12, the app is accessed with no proxy specified.

For item 13, the request is a web service.

Angelo
  • 1,578
  • 3
  • 20
  • 39
  • Although tangentially related, take a look at [How to enable IIS compression for WCF services](http://stackoverflow.com/questions/1735088/how-to-enable-iis-compression-for-wcf-services). – Joshua Drake Apr 10 '12 at 15:35
  • And [Gzip compression with WCF on IIS7](http://stackoverflow.com/questions/2713203/gzip-compression-with-wcf-hosted-on-iis7) – Joshua Drake Apr 10 '12 at 15:39
  • Yet another possible solution [asp.net and wcf compression via iis](http://www.traviswhidden.com/PublicBlog/tabid/358/EntryId/420/asp-net-and-wcf-compression-via-IIS.aspx) – Tung Apr 11 '12 at 11:45
  • These are all great suggestions for learning more about the general topic. That said, Angelo must be cautioned that IIS5, IIS6 and IIS7 compression dramatically changed between each version. IIS5 was terrible, IIS6 was tough to configure and IIS7 finally started to become "turn key". So to read on non-version specific articles means he should take what he learns with a **MASSIVE** grain of salt. – Dylan - INNO Software Apr 11 '12 at 20:26

1 Answers1

2

Angelo,

The combination of settings on IIS6 are super sensitive and unforgiving. For example, the various configurable file extensions must each start on a new line - not delimited by spaces. The touchiness of IIS6's compression is especially true where dynamically generated content (like returns from webservices) is involved.

Try the settings below, do an IIS Reset to reload these metabase changes, and cross your fingers!

<IIsCompressionScheme Location ="/LM/W3SVC/Filters/Compression/deflate"
    HcCompressionDll="%windir%\system32\inetsrv\gzip.dll"
    HcCreateFlags="0"
    HcDoDynamicCompression="TRUE"
    HcDoOnDemandCompression="TRUE"
    HcDoStaticCompression="TRUE"
    HcDynamicCompressionLevel="10"
    HcFileExtensions="htm
                      html
                      xml
                      css
                      txt
                      rdf
                      js"
    HcOnDemandCompLevel="10"
    HcPriority="1"
    HcScriptFileExtensions="asp
                            cgi
                            exe
                            dll
                            aspx
                            asmx"
        >
</IIsCompressionScheme>
<IIsCompressionScheme Location ="/LM/W3SVC/Filters/Compression/gzip"
    HcCompressionDll="%windir%\system32\inetsrv\gzip.dll"
    HcCreateFlags="1"
    HcDoDynamicCompression="TRUE"
    HcDoOnDemandCompression="TRUE"
    HcDoStaticCompression="TRUE"
    HcDynamicCompressionLevel="10"
    HcFileExtensions="htm
                      html
                      xml
                      css
                      txt
                      rdf
                      js"
    HcOnDemandCompLevel="10"
    HcPriority="1"
    HcScriptFileExtensions="asp
                            cgi
                            exe
                            dll
                            aspx
                            asmx"
        >
</IIsCompressionScheme>
<IIsCompressionSchemes Location ="/LM/W3SVC/Filters/Compression/Parameters"
    HcCacheControlHeader="max-age=86400"
    HcCompressionBufferSize="8192"
    HcCompressionDirectory="%windir%\IIS Temporary Compressed Files"
    HcDoDiskSpaceLimiting="FALSE"
    HcDoDynamicCompression="TRUE"
    HcDoOnDemandCompression="TRUE"
    HcDoStaticCompression="TRUE"
    HcExpiresHeader="Wed, 01 Jan 1997 12:00:00 GMT"
    HcFilesDeletedPerDiskFree="256"
    HcIoBufferSize="8192"
    HcMaxDiskSpaceUsage="99614720"
    HcMaxQueueLength="1000"
    HcMinFileSizeForComp="1"
    HcNoCompressionForHttp10="FALSE"
    HcNoCompressionForProxies="FALSE"
    HcNoCompressionForRange="FALSE"
    HcSendCacheHeaders="FALSE"
        >
</IIsCompressionSchemes>
  • Angelo, I also recommend Fiddler2 for a nice tidy way to evaluate the changes to the size of the content. If you run it before making changes and save the output of loading your page you'll have a benchmark to measure future tests against. – Dylan - INNO Software Apr 11 '12 at 20:28
  • It was mentioned - "configurable file extensions must each start on a new line". How about the spaces that separate the file extensions? Are they tabbed 3times? – Angelo Apr 12 '12 at 14:02
  • @Angelo I think it'll work as long as you've actually got a carriage return in there. The issue is when they are on the same line with only spaces. For your test try just adding ASMX, once you've confirmed it's working you can add more extensions to play around with supporting multiple extensions. – Dylan - INNO Software Apr 12 '12 at 20:10
  • I actually tried using just asmx, but the data is still not being compressed. – Angelo Apr 13 '12 at 19:28
  • @Angelo I'm at a loss without seeing some kind of "ah-hah!" type of information. Out of curiousity did you test to see if *any* type of compression on *any* file type worked? Being that NOTHING works, I'm starting to wonder if somehow your server is actually running in isolation mode for IIS5. When you look under task manager on that server, do you see a W3WP.EXE or ASPNET_WP.EXE running? Are you familiar with isolation mode configuration? If not, read this: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/ed3c22ba-39fc-4332-bdb7-a0d9c76e4355.mspx?mfr=true – Dylan - INNO Software Apr 14 '12 at 16:55
  • No, the server is not running on IIS 5 isolation mode. And I did checked with other file / dynamic return types and nothing gets compressed. I ran the .bat script as provided here - http://angryhacker.com/blog/archive/2007/09/08/iis-compression-and-.net-web-services.aspx and did things manually but to to no avail. – Angelo Apr 15 '12 at 17:19