1 월에 AppFabricOutputCacheProvider에 대한 일부 VB 코드를 작성했습니다. 내 블로그 here에 있습니다. C# (4.0) 버전은 다음과 같습니다.
using System.Web;
using Microsoft.ApplicationServer.Caching;
namespace AppFabricOutputCache
{
public class CacheProvider: System.Web.Caching.OutputCacheProvider, IDisposable
{
DataCache mCache;
const String OutputCacheName = "OutputCache";
public void New()
{
DataCacheFactory factory;
factory = new DataCacheFactory();
mCache = factory.GetCache(OutputCacheName);
}
public override Object Add(String key, Object entry, DateTime utcExpiry)
{
mCache.Add(key, entry, utcExpiry - DateTime.UtcNow);
return entry;
}
public override object Get(string key)
{
return mCache.Get(key);
}
public override void Remove(string key)
{
mCache.Remove(key);
}
public override void Set(string key, object entry, DateTime utcExpiry)
{
mCache.Put(key, entry, utcExpiry - DateTime.UtcNow);
}
public void IDisposable.Dispose()
{
mCache = null;
}
}
}
이 응용 프로그램에서 사용하려면 web.config에 필요합니다.
<caching>
<outputCache>
<providers>
<add name="AppFabricOutputCacheProvider" type="AppFabricOutputCache.CacheProvider"/>
</providers>
</outputCache>
</caching>
군나르 Peipman는 자신의 블로그 here에 디스크 기반 출력 캐시 공급자가 있습니다.
AppFabric은 약간 혼동되어 구성 할 수 있습니다. 도움이 필요한 것이 있습니까? – PhilPursglove