IIS 6 Compression

bcorbett

Active member
Joined
Oct 16, 2006
Messages
27
Programming Experience
Beginner
I have the following function running in a webservice:

VB.NET:
<WebMethod()> _
 Public Function Mobile_ReturnDataset_New(ByVal UDID As String, ByVal DeviceID As String, ByVal Passkey As String, ByVal LastRev As String) As DataSet
        Try
         
              
                Dim dsDemoData As DataSet = New DataSet
                dsDemoData = GetDataset("exec pr_wsSelectMobileDemo '" & Passkey.Trim & "','" & UDID.Trim & "'")
                UpdateAuditLog(Passkey, UDID, LastRev, "Demo")
                Return dsDemoData
            

        Catch ex As Exception
            Dim ds As DataSet = New DataSet
            ds = ErrorMsg("System Error: " & Replace(Replace(ex.Message.ToString, "'", " "), Chr(39), " "))
            Return ds
        End Try


    End Function

This method is used by an iPhone app. The developers who are writing the iPhone app have asked me to implement G ZIP compression. I researched this and found some articles saying that you can set this up in IIS 6. So I went to IIS and did the following.

1. Right Click on "Web Sites"
2. Clicked "Properties"
3. Clicked "Services"
4. Under "HTTP Compression" I checked "Compress application files" and "Compress static files"

Then I pressed "Ok".

But this didn't seem to have any effect. The method returned the raw XML, no compression.

I restarted the IIS server and that didn't have any effect.

I rewrote the method to return a compressed Byte array, but the developers preferred that we do the compression at the server level.

Does anybody know what I'm doing wrong here? :confused:

Thanks In advance.
 
Well first off the whole point of using compression is to compress the data from the server and decompress it at the client, to reduce network bandwidth. To implement HTTP compression, the client (web browser or otherwise) must request it by announcing it supports GZIP compression in its request header (Accept-Encoding: gzip, deflate), and the server must confirm which supported encoding format it will use for the data (Content-Encoding: gzip). What you implemented is the server side compression support, but you must also make sure the client requests compression.

The question is, does the iPhone web browser support GZIP encoding? Also keep in mind the whole thing is transparent, the data you get back at user level will already be decompressed. You can verify that compression is working by examining the server response headers to a request.
 
Back
Top