C# HttpRuntime.Cache.Insert() Not holding cached value

后端 未结 5 1176
独厮守ぢ
独厮守ぢ 2020-12-15 23:35

I\'m trying to cache a price value using HttpRuntime.Cache.Insert(), but only appears to hold the value for a couple hours or something before clearing it out. What am I doi

5条回答
  •  情话喂你
    2020-12-15 23:45

    By default, items added to the cache have no set expiration, so this is definitely something outside the cache. I agree with Josh, you should check the recycle time on your App Pool.

    Check out this page to see an example of how you can add a delegate to let you know exactly when your item is being removed from the cache. This might help you in troubleshooting if it's not your App Pool:

    http://msdn.microsoft.com/en-us/library/system.web.caching.cache.add.aspx

    ~md5sum~

提交回复
热议问题