本文介绍了是否有System.Runtime.Caching某种形式的CacheDependency的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听说.NET 4中有一个新的缓存API。

I heard that .NET 4 has a new caching API.

好了,好老的System.Web.Caching.Cache (这是,顺便说一下,仍然存在于.NET 4)具有设置这样的能力-called 的CacheDependency 对象,以确定是否缓存项过期。

Okay, so the good old System.Web.Caching.Cache (which is, by the way, still there in .NET 4) has the ability to set so-called CacheDependency objects to determine whether a cached item is expired or not.

你也可以用于确定缓存项是否仍然可用与否由的CacheDependency 导出自定义子类指定自定义逻辑。

One can also specify custom logic for determining whether a cached item is still useable or not by deriving a custom subclass from CacheDependency.

我很好奇,是有没有办法在新的API提供了这样的逻辑?

I'm curious, is there a way to provide such a logic in the new API?

推荐答案

我还没有真正使用过它,不过也从类派生ChangeMonitor类似乎起到类似的目的。

I haven't really used it yet but classes derived from ChangeMonitor Class appear to serve a similar purpose.

这篇关于是否有System.Runtime.Caching某种形式的CacheDependency的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 12:37