Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scope of HttpRuntime.Cache

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?

like image 950
Jay Avatar asked Oct 15 '13 15:10

Jay


1 Answers

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.

like image 61
Jace Rhea Avatar answered Sep 21 '22 17:09

Jace Rhea