Thursday, May 19, 2011

Cache a File and clear it when the file changes

There is a few to achieve this objective, one of the way to do this is by using

FileWatcher class.

however there is an easier approach to do this by using CacheDependency. here is a sample code

Cache.Insert("Name", myArrayList, New CacheDependency("C:\Images")
Cache will update itself if any files are added, deleted, or edited.

ref: http://www.velocityreviews.com/forums/t92933-cache-dependency-question.html

No comments:

Post a Comment