Does http compress also compress view state?

I am currently working on a large asp.net project that has been around for several years. Recently, some time has been allocated for performance optimization, because the number of requests and throughput for them were too large, so I did some research in this area, and in addition to other solutions, I also implemented ViewState compression, overriding LoadPageStateFromPersistenceMedium and SavePageStateToPersistenceMedium , and dynamic is also allowed compression from IIS. Both of them showed significant improvements in load testing.

My question, as indicated in the title of this, does http compression also compress ViewState before sending requests? If so, is it worth storing the ViewState compression and why?

Thanks.

+6
source share
1 answer

HTTP compression compresses the data sent from the server to the client. If you set up dynamic content compression , your viewstate, part of the HTML as a hidden input element , will be compressed by IIS.

Those huge widgets that are only compressed from the server to the client should still be loaded for each request, since the clients do not perform compression .

So, if you apply compression before writing a viewstate in HTML, there will be less postback from the client. As discussed here , there is usually no point in compressing the compressed data again, since basically it will only increase the size.

However, compression of dynamic content may compress other response elements, possibly still producing a clean result. You will need to measure it. :-)

+5
source

All Articles