开发者

Shrinking Session State in ASP.Net 4.0

I need more information on new feature in ASP.Net 4.0 Shrinking Session State.

My question is I am using session-state provider that stores data in a Microsoft SQL Server database. If I add compressionEnabled="true" key in web.config file as shown below and not do any code change, will application performance improve. How to check whether compression of sessions are happening and stored in SQL Server. Can any one share any sampl开发者_C百科e code to implement and test this.

   <sessionState
   mode="SqlServer"
   sqlConnectionString="data source=dbserver;Initial Catalog=aspnetstate"
      allowCustomSqlDatabase="true"
      compressionEnabled="true"
     />


Once you enable compression, session data will be GZip compressed when you use a state server or SQL server but will cost additional CPU cycles on your web server to perform the compression/decompression. This will result in smaller data being transmitted over the wire which will improve performance. Notice that while this reduces the actual session data it is still considered as bad practice to store big amounts of data into the session.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜