This is the follow up question to the question I already asked. It was answered but I had a follow up question and I posted as a comment there. Since I did not get answer there, I am posting here.Please excuse.
This is my question : .Net Cache expiration
Now my Follow up question :
Will cacheItemRemovedCallback be called during application restart/ app pool recycle?
If yes, can I reload the cache there? Is that right?
Or check the condition only if the cacheitemremovedreason is expired and only then reload the cache?
If I am wrong, Please advise how to handle the app pool recycle or appalication restart.
Thanks for the help!
The cache will be empty on AppPool and AppDomain restarts. There will be no event fired about “item removed” as new AppDomain will have no prior knowledge about items that were in the cache.
If you for some reason need to re-populate cache – you can do it on application start, also simply allowing cache to be populated on demand may be better option.