Programming Journal C#, Java, SQL and to a lesser extent HTML, CSS, XML, and regex. I made this so other programmers could benefit from my experience.

Tuesday, November 13, 2007

Caching Methods in ASP.NET 2.0

How To Cache



























Method Implementation Sample uses

Programatic Caching


Set:


Cache.Insert("UniqueKey", myData,
null, DateTime.Now.AddMinutes(5), System.Web.Caching.Cache.NoSlidingExpiration);



Get:

Cache["UniqueKey"].ToString();


Session State Caching


Set:


Session.Add("UniqueKey", myData);





Get:


Session["UniqueKey"];


Caching to Disk

Application Cache Block


Caching to Database

CodeProject
Article


link

No comments: