[RESOLVED] CacheItemRemovedCallback not firing on remote server
Hello,
i have an ASP.NET application that needs to check a database daily and send emails.
I am using cache item expire to do that, on my localhost everything works fine but on my shared hosting server the CacheItemRemovedCallback events doesnt fire.
The code that works on my localhost is :
Quote:
'test code, set to expire after 1 minute
onRemove = New CacheItemRemovedCallback(AddressOf CacheItemRemovedCallback)
HttpContext.Current.Cache.Insert(DummyCacheItemKey, "SendEmail", Nothing, DateTime.Now.AddSeconds(60), Cache.NoSlidingExpiration, CacheItemPriority.Normal,onRemove)
Could be something that blocks this code on my shared hosting sever?
Thank you!
Re: CacheItemRemovedCallback not firing on remote server
After reading your post I was researching this for my own knowledge and the examples I saw all included a new System.Web.Caching.CacheDependency value. Why did you not include it? Again, just asking for my own learning
example...
Code:
HttpContext.Current.Cache.Insert("CACHE_KEY", cacheditems,
new System.Web.Caching.CacheDependency(Server.MapPath
("~//CacheDependentFile.txt")), Cache.NoAbsoluteExpiration,
Cache.NoSlidingExpiration, CacheItemPriority.Default, OnCachedItemRemoved);
Re: CacheItemRemovedCallback not firing on remote server
After reading your post I was researching this for my own knowledge and the examples I saw all included a new System.Web.Caching.CacheDependency value. Why did you not include it? Again, just asking for my own learning
example...
Code:
HttpContext.Current.Cache.Insert("CACHE_KEY", cacheditems,
new System.Web.Caching.CacheDependency(Server.MapPath
("~//CacheDependentFile.txt")), Cache.NoAbsoluteExpiration,
Cache.NoSlidingExpiration, CacheItemPriority.Default, OnCachedItemRemoved);
Re: CacheItemRemovedCallback not firing on remote server
Yes, it worked that way. Thank you very much for your support!
Re: [RESOLVED] CacheItemRemovedCallback not firing on remote server
Good deal, please mark the thread Resolved. Thanks