This is a migrated thread and some comments may be shown as answers.

How to compress HTTP request (not response)

1 Answer 171 Views
Compression
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 1
Joel asked on 17 Jan 2018, 09:59 PM

I am currently successfully compressing the server responses to HTTP requests for both regular requests and XMLHTTPRequests.

 

Unfortunately, some of my users are experiencing the following (per browser's debugging tools):

- The Request Header specifies its content-length at over three million bytes

- The Form Data section of the Request does in fact contain the key "__VIEWSTATE", whose value is 3MB (corroborating the Request Header size)

- The Request Sent time is over a minute, because the upload speed is abysmal.

 

So, I'm interested in compressing the view state specifically for XMLHTTPRequests, with the expectation that this will behave better with the user's upload speeds. I've attempted to use the RadCompression module to do this, and have been unsuccessful, which leads me to my question here:

 

How can I compress the Request Header of an AJAX request (containing the view state)?

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 19 Jan 2018, 03:09 PM

Hello Joel,

My best advice is to consider optimizing the viewstate usage, compressing the headers themselves will not save you a lot of bandwidth, as the POST payload that contains the values of the inputs is large.

There are two main ways to do that:

  • disable the viewstate for controls you do not need it for
  • store the viewstate on the server rather than in a hidden field

IIS already has a dynamic content compression module so the data sent to the browser (which is what the browser sends to the server in terms of the ViewState) is is already compressed. RadCompression was created years ago when such a feature was not available and as such, I recommend the IIS feature over RadCompression. 

Regards,

Marin Bratanov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Compression
Asked by
Joel
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or