Reputation: 61
I have two sites that are using the same data between their sites except one of the sites is the content management system. Within the content management system when an item is saved, it expires the cache for the particular object.
The other site, I would like to use the cache so I don't have to keep making round trips to the database. If I'm using the same cache keys/object between these sites that are sharing the same app pool, will the site that isn't the CMS in this case reflect it's cache has expired and retrieve the new object?
Upvotes: 6
Views: 2608
Reputation: 3771
No, because cache will be specific to AppDomain, NOT AppPool. See this question to share cache across the applications of same app pool. Shared variable across applications within the same AppPool?
Upvotes: 2
Reputation: 693
You answer is summed up in just 2 words - "Application Cache". It applies to individual apps, and doesn't care about AppPool, so it doesn't work as you're expecting. Perhaps you can look into session sharing between the 2 apps.
Upvotes: 0
Reputation: 10604
The two applications run in the same application pool, but they do not run in the same memory space. You can think of the two applications as having their own distinct set of memory pointers and thus, one does not affect the other. You can't access another application's variables and cache lifetimes have no effect, even if they are to the same data store.
Upvotes: 6