是否可以从其他应用程序中检索HttpRuntime.Cache
?
我有两个申请,
例如App-A,App-B
在App-A中我正在向缓存中插入值
HttpRuntime.Cache.Insert(sCacheKey, sCacheValue, Nothing, Now.AddHours(CInt(System.Configuration.ConfigurationManager.AppSettings("CacheExpirationHours"))), TimeSpan.Zero)
我无法检索App-B中的值
Dim strList As String
strList = HttpRuntime.Cache.Get(sCacheKey)
它只是作为Nothing返回。我做错了什么?
答案 0 :(得分:6)
HttpRuntime.Cache,因此您无法从其他应用程序访问它。如果您希望其他应用程序访问它,您需要通过wcf,web api等公开该缓存。还要考虑使用分布式缓存。