ASP.NET 4 introduces a new option called ‘compressionEnabled’ to compress session state and improve application performance.
When you are storing session state in a State Server or SQL Server and have set the ‘compressionEnabled’ attribute to true, ASP.NET compresses session-state data. I have heard that internally it uses the GZip stream to compress and decompress session data.
Add the following entry in your web.config file with the compressionEnabled attribute set to true, as shown below:
Note: Since Compression and Decompression is involved, your application will consume additional CPU cycles to perform the operation. However compressing session state will lead to better performance of your application.