我在Azure WebRole中運行角色緩存。 當我在緩存中插入一個對象時,我指定了一個15秒的時間跨度,但對象在插入後會過期1分半鐘。Azure角色緩存 - 到期時間不起作用
問題是:是否存在到期時間的最小值?可以是15秒嗎?
更新: 當我說對象未在規定時間到期了,我的意思是,我沒有收到預期的「刪除回調」,在配置的時間。我有以下配置:
DataCacheFactoryConfiguration config = new DataCacheFactoryConfiguration();
config.NotificationProperties = new DataCacheNotificationProperties(1000, TimeSpan.FromSeconds(1));
cacheFactory = new DataCacheFactory(config);
cacheAbsolute = cacheFactory.GetCache("absolute");
foreach (CacheAbsoluteRegion reg in Enum.GetValues(typeof(CacheAbsoluteRegion)))
{
cacheAbsolute.CreateRegion(reg.ToString());
cacheAbsolute.AddRegionLevelCallback(reg.ToString(), DataCacheOperations.RemoveItem, new DataCacheNotificationCallback(RemoveCallback));
}
後我添加的對象與15秒的時間跨度,回調被稱爲插入物後1和2分鐘之間。
您可以從您的設置中發佈Microsoft.WindowsAzure.Plugins.Caching.NamedCaches字符串嗎? – gdc
{"緩存":[{"名":"默認","政策":{"驅逐":{"類型":0},"期滿":{" defaultTTL ":1," isExpirable ":真, "類型":2}," serverNotification ":{"的IsEnabled ":真}},"次級":0},{"名":"絕對","政策":{"驅逐":{"類型":0},"期滿":{" defaultTTL ":10," isExpirable ":真,"類型":1}," serverNotification " :{" isEnabled ":true}}," secondaryaries ":0}]} –
有兩個命名緩存,一個有滑動過期,另一個絕對過期。 –