gpt4 book ai didi

.net - Azure AppFabric 输出缓存是否支持读取或编程失效?

转载 作者:行者123 更新时间:2023-12-03 00:34:26 26 4
gpt4 key购买 nike

我想知道当前在 Azure AppFabric SDK 中提供的输出缓存提供程序是否支持 (1) 中描述的内容:

Normally when a get request fails the client is responsible for loading the missing data from slow storage (e.g. a database, file server, or remote service) and populating the cache. This triples the number of round-trips needed for the request and introduces the possibility for a race condition. With Read-Through support turned on AppFabric itself makes the secondary call to slow storage. AppFabric gains this ability via a custom implementation of the abstract class DataCacheStoreProvider.

(3) 的“下一步”部分似乎表明事实并非如此:

In addition, the success of the Caching session state provider scenarios with ASP.NET has resulted in requests for the ability to associate write-behind and read-through queries with the cache so that the cache can become the primary way to manipulate data, while letting the associated queries update the data tier in the back end.

We’ll be evaluating these and other features for possible inclusion in future releases of Windows Azure AppFabric Caching. In the meantime, we encourage you to experiment with the current Caching service implementation and let us know how it works for you.

是否有任何其他机制可以以编程方式 a) 失效和 b) 替换缓存页面,而不让它通过客户端请求自然地重新水化(这可能会导致负载下的问题,因为所有请求都竞相重新水化元素) ?

与 Windows Server 的其他记录差异 (4):

ASP.NET Caching

Windows Azure AppFabric provides both a session state provider and an output cache provider. This provider differs from the one that shipped with the first release of Windows Server AppFabric. It also provides additional features. Because of this, it is important to carefully follow the instructions for modifying the web.config file correctly for Windows Azure AppFabric. For more information, see Using the ASP.NET 4 Caching Providers for AppFabric.

Unavailable Caching Features

Windows Azure AppFabric supports a subset of the caching features available in Windows Server AppFabric. The following list describes some of these differences.

Notifications

Notifications are not supported in Windows Azure AppFabric Caching. This also means that you cannot use notifications to invalidate the local cache. In Windows Azure AppFabric, local cache can use only a timeout based invalidation policy. For more information about the notifications feature in Windows Server AppFabric, see Cache Notifications (Windows Server AppFabric Caching).

Expiration and Eviction

By default, items in a Windows Azure AppFabric cache do not expire. This means that when you exceed your maximum cache size, the least recently used items in the cache are evicted. Unlike Windows Server AppFabric, there is no way to change this default expiration setting or value. However, if you add items to the cache with an explicit expiration time, such as 10 minutes, then the cache will honor this expiration value. This can be done with various overloads of the Add and Put methods. Note that the ASP.NET providers automatically use these overloads to provide explicit timeouts for session state and output caching.

Windows Azure AppFabric Caching does not support disabling eviction on a cache. Under memory pressure, it is always possible that items could be evicted. Applications should be designed to anticipate that items might be missing and require reloading at any time. If a cache is too small for the application requirements, it can be dynamically increased from the Windows Azure Platform Management Portal.

For more information on expiration and eviction in Windows Server AppFabric, see Expiration and Eviction (Windows Server AppFabric Caching).

High Availability

Windows Azure AppFabric Caching does not support the high availability feature. For more information about high availability in Windows Server AppFabric, see High Availability (Windows Server AppFabric Caching).

Regions and Tags

Windows Azure AppFabric Caching does not support user-created regions or tag-based searches.

API Support

In most cases, you can use the same APIs to write cache clients that use Windows Azure AppFabric or Windows Server AppFabric. There are some exceptions due to differences between the two solutions. For a detailed review of the APIs available for Windows Azure AppFabric cache clients, seeAPI Reference (Windows Azure AppFabric Caching).

引用文献:

(1) Windows Server AppFabric 添加了 Read-Through 和 Write-Behind 支持: http://www.infoq.com/news/2011/08/AppFabric-CTP

(2) ASP.NET 4 的可扩展输出缓存(VS 2010 和 .NET 4.0 系列): http://weblogs.asp.net/scottgu/archive/2010/01/27/extensible-output-caching-with-asp-net-4-vs-2010-and-net-4-0-series.aspx

(3) Windows Azure AppFabric 缓存服务简介:
http://msdn.microsoft.com/en-us/magazine/gg983488.aspx

(4) 本地缓存和云端缓存的区别:
http://msdn.microsoft.com/en-us/library/gg185678.aspx

最佳答案

正如您引用的文档所示,无法使用 Windows Azure 共享缓存服务(以前称为 Windows Azure AppFabric 缓存)使本地缓存失效。这是因为该服务不支持通知。如果您没有在该服务中使用本地缓存选项,那么您可以通过显式删除缓存项来使其失效。这会将其从服务中的分布式缓存中删除,然后所有请求它的实例将一无所获。

至于替换缓存页面,我相信你可以通过直接更新缓存来实现;然而,考虑到从缓存中删除某些内容时涉及的因素很多,您可能无法 100% 保证页面最终不会因压力而掉落,并且无论如何都会发生竞争。

如果您想要对缓存有更多控制,我强烈建议您查看新的 Windows Azure 专用缓存预览版。它仍处于预览阶段,因此您可能不想在生产工作中冒险,但它将使您对缓存有更多的控制。

关于.net - Azure AppFabric 输出缓存是否支持读取或编程失效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7340259/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com