How to use gzip Content-Encoding in plain text upload?

2k views Asked by At

I have a situation where
user required to download big text file (1-15 MB) CSV file
which after edited using Excel,
re-uploaded as-is (edited CSV)
to site using web browser in the same page.

gzip encoding applied for download
and content sent to user is gzip compressed (seen through firebug)

Problem is when user re-uploading edited file,
it is transmitted as non compressed text (is it ?).
Limited user bandwidth (around 50-128 KBps upload)
and quite large user base (more than 100 concurrent users)
will force site down to unacceptable performance (over one minute response-time)
when concurrent upload/download being executed.

Question: How do I make client browser send file Upload via HTTP Post
using gzip content encoding and compression
behind the scene?

We can instruct user to zip file before uploading,
but given circumstances that various archive file format can be produced
and adding step for user is making adoption of "archiving" is not a viable option,

Edit

and server side decompression processing will add burden
to already busy server.

Rephrased

while server side decompression logic for various format
will add complexity to server side code.
Decompression burden itself is acceptable due to
transfer time and bandwidth usage reduced by using compression.

Info

  • Server: IIS
  • Made using ASP.NET MVC 3,
    Visual Studio 2010 C# 4.0,
    DevExpress 12 MVC extension,
    UploadControl Component

Similar question does not yield desired answer:

Compressing HTTP Post Data sent from browser

some even left unanswered :

Implement http compression for post data

1

There are 1 answers

2
Ashigore On

and server side decompression processing will add burden to already busy server.

Using gzip for downloads will be worse, generally compression is much more processor intensive than decompression.

There is no way to magically force gzip for the upload and even if you did manage it, the decompression will always be done by the server which you say you don't want.

It sounds to me like your solution simply does not fulfill your service requirements any longer. You'll likely either have to live with it or face an upgrade of some kind.