Cache dependency on a web file
Hi,
i have a scenario in which i need to cache a centrally hosted xml file and there should be a cache dependancy on the file so that updates to the file refresh the cache. Is this possible?
This is the code
<code>
public Xpathdocument GetSiteLocaleURLXMLFile(string url)
{
System.Net.HttpWebRequest request;
//System.Net.HttpWebResponse response;
try
{
request = (System.Net.HttpWebRequest) System.Net.WebRequest.Create(url);
return (XpathDocument)request.GetRequestStream();
}
catch (Exception e)
{
throw new Exception();
}
}
HttpContext.Current.Cache.Add(getCacheName(),GetSi teLocaleURLXMLFile(someURL),,,,,,,).
</code>
I have no network access to this XML file and can get it only by making a web request.
here i get a xml file by making a web request, In this case can i assign cachedependency ????:)
My question is
ashish
|