Sorry for the delay, busy, busy, busy.
What a cache dependancy is... you can store objects using into cache and can set it to a dependency to for expiration. That dependency can be time, a file, or other things, I use time and files mostly.
The cache store the object, not just the path. You can store the path to the file in the application setting but not the object.
Here is example of how to use it. With a file dependance, if the file gets changed the cache (stored in memory) will expire itself and (using the example below) force a new read of the file.
If HttpContext.Current.Cache("FeaturedPropertyXMLItems") Is Nothing Then
Dim dst As New DataSet
dst.ReadXmlSchema(HttpContext.Current.Server.MapPath("~/resources/featuredproperties/listings.xsd"))
dst.ReadXml(HttpContext.Current.Server.MapPath("~/resources/featuredproperties/listings.xml"))
HttpContext.Current.Cache.Insert("FeaturedPropertyXMLItems", dst, New CacheDependency(HttpContext.Current.Server.MapPath("~/resources/featuredproperties/listings.xml")))
dst = Nothing
Else
Dim dst As DataSet = CType(HttpContext.Current.Cache("FeaturedPropertyXMLItems"), DataSet))
End If
I hope this helps.
-Wayne