'IIS App Pool And Caching
I have created a public List that is runs and is accessed from my a Web Application.
private static List<x> _x;
static readonly object lockObjx = new object();
public static void XCache()
{
if (_x != null)
return;
lock (lockObjx)
{
_x = GetFromDatabase();
}
}
This all runs happily under the default app pool. I now need to add a web service that can update the this cache. Will I be able to do this running on the default app pool? If not is there a way I can do this without installing something like MEMCache. The Service and and Wepp run on the same server.
Solution 1:[1]
Cache and sessions are specific to the AppDomain(NOT App Pool).
Different web applications will always have different App Domains, even if they're running under same app pool. So they will have separate cache, separate session, separate objects, separate static references, etc.
However, there's a way to share cache/objects between different applications of same app pool : Shared variable across applications within the same AppPool?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
