Answer: For storing data, ASP.NET provides 2 options namely,
1) Out of process session state
2) MS SQL server session state
Session-state providers stores the data out side the web application worker process in both the cases. Session state has to be serialized before it sends it to the external storage.
In ASP.NET 4.0, a new compression option is introduced for both out-of-process session state providers. We can set the compressionEnabled="true" in configuration file. ASP.NET will compress the session state by using the .NET Framework System.IO.Compression.GZipStream class.
Example:
<sessionState
mode="SqlServer"
sqlConnectionString="data source=dbserver;Initial Catalog=aspnetstate"
allowCustomSqlDatabase="true"
compressionEnabled="true"
/>
Asked In: Many Interviews |
Alert Moderator