Groups | Blog | Home
all groups > asp.net caching > august 2006 >

asp.net caching : Losing Cached values


Carl Davis
8/17/2006 4:11:00 PM
Hi,

We have an ASP.net 1.1 application which loads an XML file into cache when
the application starts up. However, when we overwrite some of the
application DLLs with new versions it appears that this cache is wiped. In
fact, the application seems unable to access the XML file until we actually
open the file in windows and save it again (no changes to file). Could
someone let me know what affect overwriting application DLLs should have on
the application itself (does it cause the app to recycle?) and why does this
cached file appear to be locked?

Thank you,
C.

Ray Booysen
8/17/2006 4:18:28 PM
Changing the Dlls will cause the application domain to recycle.
Are you sure that you are closing the file properly after reading it
into cache?

Regards
Ray


[quoted text, click to view]
Carl Davis
8/17/2006 4:35:37 PM
Hi Ray,

This is the function that does the caching:

private static System.Web.Caching.Cache objCache =
System.Web.HttpRuntime.Cache;
private static XmlDocument XMLDoc = new XmlDocument();

private static void CacheXML(string XMLFileName)
{
XMLDoc.Load(XMLFileName);
objCache.Insert("CachedSettings", XMLDoc, new
CacheDependency(XMLFileName));
}



[quoted text, click to view]

AddThis Social Bookmark Button