Tuesday, October 21, 2008

Session, ViewState, Cache, Application


Session

View State

Cache

Application

Modes

In-Proc,

State Server,

SQL Server

-

Page Output Cache,

Fragment Cache,

Data Cache,

Data Source Cache

-

Dependency

Cookie – if not a cookie less to store Session ID.

e.g. ASP.NET_SessionId cookie gets created.

Cookie less – URL append with Session Id.

SQL Cache Dependencies,

File,

Query String Key

Storage Location

Data is stored in memory (in process),

Web Server.

Page (but can be modified to overwrite the storage mechanism to
store viewstate else where, esp. Session, Application, File or DataBase)

Data is stored in memory (in process),

Web Server

Data is stored in memory (in process),

Web Server

Can Store

Complex Objects & Any Data

e.g. DataSet

Any serializable class to View State.

e.g. Strings, DateTimes, and Integers

Page Output, Complex Object (e.g. DataSet),

Note

Anything that you add to View State must be added to the hidden __VIEWSTATE form field. If this field gets too big, it can have a significant impact on your page's performance.

View State is loaded after the Page InitComplete event, and View State is saved after the Page PreRenderComplete event. This means that you should not attempt to retrieve a value from View State before or during the InitComplete event. You also should not attempt to add a value to View State after the PreRenderComplete event.

Application state is little used in ASP.NET applications. In most cases, you should use the Cache object instead of Application state because the Cache object is designed to manage memory automatically.

Thanks,

Paresh Bhole

No comments:

Hello

Thanks for checking out my post...

... Paresh Bhole