Wednesday, September 19, 2012

Optimisation of Session in asp.net

Optimisation of session is arranging session in a proper manner to improve performance of the web server.The optimisation can be applied at 2 levels
1.Page Level
2.Website Level

PageLevel:
In the page level optimisation requires enable session state option with page directive
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2"  EnableSessionState="true"%> 


It has three properties i:e
True:Session tracking takes place ,program with be loaded for reading and writing
False:No session tracking,this will reduce processing burden on server
Read Only:Session tracking program loaded for reading,this will reduce burden compare to true

WebSite Level:Website level optimisation requires settings under web.config
<Sessionstate mode="off"/>

This will in form web server not to create sessions for website.This will reduce processing burden on web server and memory wasted will not take place

No comments:

Bel