[英]why data i stored in cache has been removed in asp.net
I decided to store my data for example List of country, state, city, book and other data in cache for speed of my web site but I found that when the cache item count is 10 and Cache.EffectivePercentagePhysicalMemoryLimit is 98 I add my data to cache but other data will remove. 我决定将我的数据(例如国家,州,城市,书籍和其他数据的列表)存储在缓存中以提高网站的速度,但是我发现当缓存项计数为10且Cache.EffectivePercentagePhysicalMemoryLimit为98时,我将数据添加到缓存,但其他数据将被删除。
I set cache expiration to 20 min.how should I set size of cache? 我将缓存过期时间设置为20分钟。如何设置缓存大小? how should I do with this problem?
我该怎么办? why data I stored in cache has been removed in asp.net
为什么我存储在缓存中的数据已在asp.net中删除
in below code I have set a breakpoint the method return an empty list and when I check other data like country and state they have been removed from cache 在下面的代码中,我设置了一个断点,该方法返回一个空列表,当我检查其他数据(如国家和地区)时,它们已从缓存中删除
var cahpters= CacheData.Data.Chapter.list(bookid.ToString());
why data i stored in cache has been removed in asp.net
为什么我存储在缓存中的数据已在asp.net中删除
Objects can be explicitly taken out of the cache when: 在以下情况下,可以将对象明确从缓存中取出:
Remove
Remove
Most probably in your case you have huge memory consumption so ASP.NET decided to save memory by removing you item from the cache. 在您的情况下,很可能您会消耗大量内存,因此ASP.NET决定通过从缓存中删除项目来节省内存。
Also you can register for removal notification (including the reason). 您也可以注册删除通知 (包括原因)。 See more about that here: https://msdn.microsoft.com/en-us/library/7kxdx246%28v=vs.140%29.aspx
在此处查看有关此内容的更多信息: https : //msdn.microsoft.com/zh-cn/library/7kxdx246%28v=vs.140%29.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.