I have to load data from 2 text files nightly to be used as lookups in a WiseJ app. This data is uploaded to our server every night at a specific time.
Thought about using the built in cache mechanism of ASP.net – but I believe i cannot set a specific time of day for it to expire the cache and reload from the text files.
The question is – can I set a “global” timer for tasks that need to be done – kind of like CRON jobs for a WiseJ application – maybe using background workers to perform the tasks ?
You can use HttpRuntime.Cache or System.Web.Caching.Cache which are basically the same thing. Look also under System.Runtime.Caching. You can use any of those. When adding an entry in the cache you can specify the absolute expiration or sliding expiration and a callback invoked when the item is removed by the cache.
You can also start any thread from your wisej app and handle things from there. Once the thread is started it goes by itself and has no relation to the wisej app.
Remember that an app pool recycle will clear the cache and stop all threads.
Please login first to submit.