简体   繁体   English

关闭ViewState加密(asp.net IIS7)有好处吗?

[英]Is there a benefit of turning ViewState Encryption Off (asp.net IIS7)?

I understand how to turn off ViewState encryption for asp.net web applications. 我了解如何为asp.net Web应用程序关闭ViewState加密。 I want to know if I should. 我想知道是否应该。 My question is more from a performance stand point than a security one (All of our traffic is on a private network and we do not store any sensitive data in the viewstate). 我的问题更多是从性能角度而不是安全角度(我们的所有流量都在专用网络上,并且我们不在viewstate中存储任何敏感数据)。

Before I dedicate hours of setting up tests scenarios, I was courious if anyone in this community has experience running apps with viewstate encryption disabled. 在投入数小时的时间来设置测试方案之前,我很想知道该社区中是否有人有运行禁用视图状态加密的应用程序的经验。 As expected, I have found a lot of conflicting view points on the Internet. 不出所料,我在Internet上发现了许多相互矛盾的观点。 I would like to hear what you guys have to say. 我想听听你们怎么说。

  • If I turn off encryption will I save any noticeable overhead in the application? 如果关闭加密功能,是否可以在应用程序中节省任何明显的开销?
  • Can I expect the overall size of the viewstate to change much? 我可以期望viewstate的整体大小发生很大变化吗? I assume the encryption also compresses the data before doing the encryption. 我假设加密在执行加密之前还会压缩数据。
  • Can the lack of ViewState compression be counter balanced by using dynamic content compression in IIS7? 是否可以通过在IIS7中使用动态内容压缩来抵消缺少ViewState压缩的问题?

Thanks in advance for any feedback you can provide! 预先感谢您提供的任何反馈!

The main difference would probably be the CPU usage to encrypt and decrypt the view state. 主要区别可能是用于加密和解密视图状态的CPU使用率。

However, you probably will not notice any difference, unless you have some really large datagrids, and even then the chances are small. 但是,除非您拥有一些非常大的数据网格,否则您可能不会注意到任何区别,即使这样,机会也很小。

It may be more usefull to go through your app and make sure that viewstate is turned off for all controls where it is not required. 遍历您的应用程序并确保不需要的所有控件的viewstate都关闭了,这可能会更有用。

Turning off viewstate has been available since .net 2.0 http://msdn.microsoft.com/en-us/library/aa479501.aspx 从.net 2.0开始,可以关闭视图状态。http: //msdn.microsoft.com/zh-cn/library/aa479501.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM