I’ve written a DLL that may be used in a number of ways (referenced by ASP.NET web sites, WinForms, etc.). It needs to load its data from several delimited files that will be automatically updated on a semi-regular basis. For performance reasons, I’m loading the data into a static object (a generic List), and only want to go back to the files when the data changes. (The amount of data doesn’t take up an unreasonable amount of memory, but it does take too long to read from the file on every access). I’ve tried using a FileSystemWatcher, but that’s proven unreliable – it periodically misses file updates. Since I can’t count on the DLL running inside a web site, the ASP.NET CacheDependency option doesn’t seem appropriate. Has anyone found a good solution to this sort of thing?
Share
Have you looked at the Enterprise Library Caching application block? It allows for cache invalidation on a number of different events,including file changes (AFAIK), and does not require ASP.NET (and yet, integrates well with it).