1

Obviously, first priority is disabling and not using Viewstate as much as possible, but if you have to, is this worthwhile? Also considering that IIS is gzipping everything for you as well. ViewState is smaller however is the trade off of CPU worth it?

http://www.dotnetcurry.com/ShowArticle.aspx?ID=67

Trying to give a client some guidance based on this.

PS: They are using .NET 2.0

Shane
  • 4,185
  • 8
  • 47
  • 64

2 Answers2

0

If IIS is already gzipping everything (specifically relevant here is the HTML document itself), then you won't gain anything by compressing it yet again with the CustomPage implementation you linked to. It would be like zipping a zip.

Stephen Swensen
  • 22,107
  • 9
  • 81
  • 136
  • This was my thought, if IIS was already gzipping, it seems like by overriding and compressing/decompressing ViewState, you are just adding extra CPU time for a task already taken care of at the IIS level. – Shane Nov 12 '10 at 16:46
  • It looks like HTTP level compression does not compress postbacks, only the main page, so maybe there is still a place for VS Compression: http://bloggingabout.net/blogs/ramon/archive/2006/09/01/Don_2700_t-use-viewstate-compression_2100_-Use-http-compression-instead_2100_.aspx – Shane Nov 12 '10 at 16:51
  • @Shane, interesting, perhaps so after all – Stephen Swensen Nov 12 '10 at 17:00
  • Here's a relevant question: http://stackoverflow.com/questions/424917/why-cant-browser-send-gzip-request – Stephen Swensen Nov 12 '10 at 17:06
0

Get view state off __VIEWSTATE

.... else get ready to be screwed!

Ramiz Uddin
  • 4,249
  • 4
  • 40
  • 72
  • so is your blog post recommending to Compress ViewState or not bother? – Shane Nov 12 '10 at 16:46
  • @Shane There is always a stuck point with ViewState. I would say you should be concerned HOW-NOT to have or HOW-TO get alternate solution of this. – Ramiz Uddin Nov 12 '10 at 20:43