Results 1 to 5 of 5

Thread: [RESOLVED] CacheItemRemovedCallback not firing on remote server

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2007
    Posts
    106

    Resolved [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!

  2. #2
    Addicted Member thetimmer's Avatar
    Join Date
    Jan 2014
    Location
    Plano, Texas
    Posts
    243

    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

  3. #3
    Addicted Member thetimmer's Avatar
    Join Date
    Jan 2014
    Location
    Plano, Texas
    Posts
    243

    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

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Nov 2007
    Posts
    106

    Re: CacheItemRemovedCallback not firing on remote server

    Yes, it worked that way. Thank you very much for your support!

  5. #5
    Addicted Member thetimmer's Avatar
    Join Date
    Jan 2014
    Location
    Plano, Texas
    Posts
    243

    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
  •  



Click Here to Expand Forum to Full Width