|
-
Mar 20th, 2014, 07:02 AM
#1
Thread Starter
Lively Member
[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 :
'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!
-
Mar 20th, 2014, 08:46 AM
#2
Addicted Member
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);
Last edited by thetimmer; Mar 20th, 2014 at 08:50 AM.
_____________
Tim
If anyone's answer has helped you, please show your appreciation by rating that answer.
When you get a solution to your issue remember to mark the thread Resolved.
reference links
-
Mar 20th, 2014, 08:47 AM
#3
Addicted Member
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);
_____________
Tim
If anyone's answer has helped you, please show your appreciation by rating that answer.
When you get a solution to your issue remember to mark the thread Resolved.
reference links
-
Mar 21st, 2014, 09:24 AM
#4
Thread Starter
Lively Member
Re: CacheItemRemovedCallback not firing on remote server
Yes, it worked that way. Thank you very much for your support!
-
Mar 21st, 2014, 10:15 AM
#5
Addicted Member
Re: [RESOLVED] CacheItemRemovedCallback not firing on remote server
Good deal, please mark the thread Resolved. Thanks
_____________
Tim
If anyone's answer has helped you, please show your appreciation by rating that answer.
When you get a solution to your issue remember to mark the thread Resolved.
reference links
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|