AppFabric本地缓存

发布于 2025-01-04 14:25:23 字数 313 浏览 3 评论 0原文

我在我的一个项目中使用 AppFabric 缓存。我知道缓存只能在服务器上可用,也可以有本地版本(我假设这是通过实例化 DataCacheLocalCacheProperties 类并将其分配给 DataCacheFactoryConfiguration 的属性来完成的) - 如果我错了,请纠正我。我还假设,如果在启用本地缓存时完成 Get,则如果本地不可用,将从缓存服务器检索该对象。

但是,看跌期权的情况如何?当我启用本地缓存时,我执行的 Put 操作会更新指定键的缓存服务器吗?如果是,那么这个值将如何反映在localcache中呢?或者,它只是更新本地缓存?

提前致谢!

I am using AppFabric caching in one of my projects. I understand that the cache can be made available server only or it can have a local version as well (I assume this is done by instantiating the DataCacheLocalCacheProperties class and assign this to the DataCacheFactoryConfiguration's properties) - please correct me if I am wrong. I also assume that if a Get is done when a localcache is enabled, the object will be retrieved from the cache server if it is not available locally.

But, what is the case of a Put? When I have a localcache enabled, a Put that I do will update the cache server for the specified key? If yes, then how will this value be reflected in the localcache? Or, it just updates the localcache?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

去了角落 2025-01-11 14:25:23

Joesph,

是的,您可以使用本地缓存将对象存储在客户端的内存中。本地缓存一般用于存储不经常更改的对象。这有助于降低与缓存服务器往返相关的延迟成本。

现在回到您的问题:-

1- 您也可以使用 xml 配置启动本地客户端缓存。 http://msdn.microsoft.com/en-us/library/ee790880.aspx

2- 当您执行“获取”时,如果缓存项在本地缓存中不可用,则会从缓存服务器中获取该缓存项。

3- Put 始终发送到缓存服务器。

4- 本地缓存具有“同步”属性,允许其通过以下方式与服务器缓存同步:a)“超时”值(这样一旦 ttl 过期,对象将根据服务器缓存进行更新)或
b) 缓存通知(这样每次服务器上的缓存更新时都会通知客户端) - 访问 http://msdn.microsoft.com/en-us/library/ee808091.aspx 了解更多详细信息。

HTH。

干杯,
//hr/

http://www.hammadrajjoub.net

Joeseph,

Yes you can use local cache to store objects in-memory at the client. Local caching is generally used to stored objects that don't change frequently. The helps with the latency costs associated with the round trip to the cache server(s).

Now coming back to your questions:-

1- You can initiate local client cache with xml configuration as well. http://msdn.microsoft.com/en-us/library/ee790880.aspx

2- When you do a Get if the cache item is not available in the local cache then it is fetched from the Cache Server(s).

3- Put always goes to the Cache Server(s).

4- Local Cache has "sync" properties that allow it to be synced with the server cache either through a) a 'timeout' value (such that once the ttl expires the object will be updated based on the server cache) or
b) Cache notifications (such that the clients are notified everytime the cache is updated on the sever) - visit http://msdn.microsoft.com/en-us/library/ee808091.aspx for more details.

HTH.

cheers,
//hr/

http://www.hammadrajjoub.net

妳是的陽光 2025-01-11 14:25:23

当应用程序更新主缓存服务器时,AppFabrics 本地缓存可能会出现问题,并且如果更新的项目副本驻留在另一个应用程序的本地缓存上,则该副本本质上是过时的,需要被逐出。我认为 AppFabric 要求客户端应用程序将其本地缓存与主缓存同步。大多数时候这是不可行的。 NCache 是使“客户端”或本地缓存始终与主缓存保持同步的缓存产品之一。欲了解更多信息,请阅读:

http://www.alachisoft.com/ncache/

Well AppFabrics local cache may have problems when an application updates the main cache server and if the updated items copy resides on a local cache for another application then that copy is essentially stale and needs to be evicted. I think AppFabric requires the client application to have its local cache synchronized with the main cache. This is not feasible most of the times. NCache is one of those caching products that keeps the "client" or local caches synchronized with the main cache at all times. For more information please read this:

http://www.alachisoft.com/ncache/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文