更新时锁定缓存? [英] Lock cache while updating it?
问题描述
我使用System.Web.Caching在VB.NET中缓存一些数据,是否可以锁定缓存以便其他会话尝试访问同一缓存
等待更新?我有缓存使用滑动超时和
a依赖于从中提取数据的文本文件。
如果它是相关的,根据当前的统计数据,我做不要期望超过
大约400人同时访问该网站。
我看到它在C#中看起来很容易但我不能找到关于VB的任何内容。
Andrew
I am caching some data in VB.NET using System.Web.Caching, is it possible to
lock the cache so that other sessions attempting to access the same cache
wait when it is being updated? I have the cache using a sliding timeout and
a dependency on the text file its data is extracted from.
If it''s relevant, based on current statistics, I do not expect more than
about 400 people to be accessing the web site at the same time.
I''ve seen it appears easy in C# but I couldn''t find anything regarding VB.
Andrew
推荐答案
Andrew,
你让我好奇,你为什么要那样做?在我看来,这是一个奇怪的解决方案,因为你应该为那些尝试在我的想法中访问缓存的其他399个人做出机制。什么时候,比什么呢?
抓住了什么?
我真的很好奇你是怎么做到的。
Cor
Andrew,
You make me curious, why would you do that? Seems to me a strange solution,
because you should than make a mechanisme for those other 399 who try to
access that cache in my idea. When it is, than what it the action on that
catch?
I am real curious about this how you did that.
Cor
Cor Ligthert写道:
Cor Ligthert wrote:
Andrew,
你让我很好奇,为什么你会那样做吗?在我看来是一个奇怪的解决方案,因为你应该为那些试图在我的想法中访问缓存的其他人做出机制。什么时候,比它对那个捕获的动作呢?
我真的很好奇你是怎么做到的。
Cor
Andrew,
You make me curious, why would you do that? Seems to me a strange
solution, because you should than make a mechanisme for those other
399 who try to access that cache in my idea. When it is, than what it
the action on that catch?
I am real curious about this how you did that.
Cor
缓存数据是一个查找表,每个用户都有相同的数据。
缓存适用于Web应用程序而不是每个会话。除非我
误解了文档。
Andrew
The cached data is a lookup table which has the same data for every user.
The cache applies to the web application rather than per-session. Unless I
have misunderstood the docs.
Andrew
Andrew,
清除,
是不是更新表格,创建一个页面来杀死
缓存并让它去再次,我假设缓存是在什么时候创建的?
什么都没有?
我从来没有使用过那个缓存,但这是我从它的理解,
可能会首先尝试这样做。
Cor
Andrew,
Clear,
Is it than not something as updating the tables, create a page to kill the
cache and let it go again, where I assume that the cache is created when it
is nothing?
I never used that cache, however that is from what I understand from it,
would probably as first try to do it.
Cor
这篇关于更新时锁定缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!