Scope of HttpRuntime.Cache

2.5k Views Asked by At

Is it possible to retrieve HttpRuntime.Cache from another application?

i am having two applications ,

for example App-A, App-B

in App-A i am inserting values to cache

HttpRuntime.Cache.Insert(sCacheKey, sCacheValue, Nothing, Now.AddHours(CInt(System.Configuration.ConfigurationManager.AppSettings("CacheExpirationHours"))), TimeSpan.Zero)

I am not able to retrieve the values in App-B

Dim strList As String
strList = HttpRuntime.Cache.Get(sCacheKey)

it is simply returning as Nothing. what i am doing wrong?

1

There are 1 best solutions below

1
Jace Rhea On BEST ANSWER

HttpRuntime.Cache exists in the app domain, so no you can't access it from another app. You'll need to expose that cache via wcf, web api, etc if you want another app to access it. Also consider using a distributed cache.