Last post Aug 02, 2011 08:04 AM by walia_jagwinder
Aug 02, 2011 04:37 AM|mkarpinski|LINK
I have a static cache of objects in my asp.net application.
What I need to do now is to invoke some kind of a background process that would monitor and alter objects in my cache let's say every 5 minutes.
The process should be invoked only once (don't know when yet - maybe at the time when teh first user connects to my application), and work continously untill it is not terminated by the server.
Any ideas where to start? I am currently thinking about employing background workers but I don't know whether this is the right way of doing things.
Thanks in advance,
Aug 02, 2011 04:47 AM|walia_jagwinder|LINK
Use Caching Dependencies
Aug 02, 2011 06:12 AM|mkarpinski|LINK
Does it work in a way that makes sure that cached items, are still present and invalidated in cache (via callbacks) after user has disconnected?
My app will have many connections and small portions of data will be created and stored for each user, and I must make sure that they are cached and refreshed all the time, no matter if the user is still connected to my website or no. All in all what I meant
to ask is wether this is server side cache.
Aug 02, 2011 06:26 AM|mkarpinski|LINK
Still I need a mechanism that will update my objects - lets say - every 5 minutes. This is not provided via Cache, so i sill need to know how to create background asynhronous thread. Cache does not support any callback like CachedItemExpiredButNotRemovedCallback,
it only informs us when the item was removed which is not sufficient for me.
Aug 02, 2011 06:46 AM|mkarpinski|LINK
Eventually I found out that ItemRemovedCallback, gives us reference to the item that actually was removed so we can modify it and put it back into Cache. However non-elegant that may be it works.
Aug 02, 2011 08:04 AM|walia_jagwinder|LINK