8/1/2010 7:12:33 PM
by
Eric
Using Dependant Cache in ASP.net
Cache.Insert("navHTML", //name of the cache item
oSB.ToString(), //what your cacheing
new CacheDependency(Server.MapPath("~/web.sitemap")), //the file that would cause cache to updated when changed
DateTime.UtcNow.AddMinutes(15), //always refresh after 15 minutes
System.Web.Caching.Cache.NoSlidingExpiration); //don't base the cache off last accessed time
String navHTML = (String)Cache["navHTML"]; //get the string out of cache