locked
HTTP Compression for Upload RRS feed

  • Question

  • Hi,

    I have implemented HTTP Compression based on the article here :-
    http://www.businessanyplace.net/?p=wscompress

    It is working very well, and we are getting a good improvement on our downloads of data.

    I have an issue with implementing HTTP compression for the upload of data where we are actually passing a very large string parameter when calling the web method.

    I think, in a similar way in which I have implemented the HTTP compression for GetWebRequest, the server code would need to take into account the compressed data we might send it.

    My questions are :-
    1. By implementing the override for GetWebRequest and GetWebResponse, does this mean the web method I am calling to perform the upload has the string parameter compressed, or do I need to compress the string manually before passing it to the web method?
    2. What changes would need to occur on the server code to allow for the compressed string to be decompressed?

    I would be very grateful for any help you might be able to provide on this issue.

    Thanks

    Paul Diston


    http://www.smartmobiledevice.co.uk/
    Wednesday, April 1, 2009 12:04 PM

Answers

  • I use SharpZipLib which compresses data to a byte array, which compresses data on upload & download.  

    I override upload methods to include a paramter which is the compressed byte array instead of a string, then de-compress this, and pass this to the Method with the string param

    Not sure if this will work with the business anyplace compression, but it works fine for me, hope this helps
    • Marked as answer by Paul Diston Wednesday, April 1, 2009 1:47 PM
    Wednesday, April 1, 2009 1:44 PM
  • Hi,

    Having thought about this a bit more, I realised that I could just compress the string before passing it to the web method and then the server code could be changed to then decompress.

    I think we will use one technique for compressing downloads and another for compressing uploads.

    Thanks

    Paul Diston
    http://www.smartmobiledevice.co.uk/
    • Marked as answer by Paul Diston Wednesday, April 1, 2009 1:47 PM
    Wednesday, April 1, 2009 1:47 PM

All replies

  • I use SharpZipLib which compresses data to a byte array, which compresses data on upload & download.  

    I override upload methods to include a paramter which is the compressed byte array instead of a string, then de-compress this, and pass this to the Method with the string param

    Not sure if this will work with the business anyplace compression, but it works fine for me, hope this helps
    • Marked as answer by Paul Diston Wednesday, April 1, 2009 1:47 PM
    Wednesday, April 1, 2009 1:44 PM
  • Hi,

    Having thought about this a bit more, I realised that I could just compress the string before passing it to the web method and then the server code could be changed to then decompress.

    I think we will use one technique for compressing downloads and another for compressing uploads.

    Thanks

    Paul Diston
    http://www.smartmobiledevice.co.uk/
    • Marked as answer by Paul Diston Wednesday, April 1, 2009 1:47 PM
    Wednesday, April 1, 2009 1:47 PM