We have several virtual applications inside one main (root) application.
How to share Cache between this virtual application and main application if they are located (and always will be) on the same physical machine?
By Cache i assuming System.Runtime.Caching or System.Web.Caching. Hope that i do not need to setup AppFabric Caching for this…
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Memcached is a free, open-source cache that runs as a Windows service. You can very easily accomplish cross-app cacheing by simply defining a key that both apps would use to look for in the memcached object(s).
Method 2
Can not be done. Multiple asp.net apps live in their own appdomain, and the appdomain is IIS controlled and may cycle at any time. This means any caching HAS to use networking scenarios (remoting etc.) and the cache better be suited outside the ASP.NET control (system service).
Method 3
While others have mentioned the built in ASP.NET Cache (System.Web.Caching), please note that .NET 4.0 introduces a whole new caching framework designed to work outside of the System.Web.Caching namespace:
System.Runtime.Caching
http://msdn.microsoft.com/en-us/library/system.runtime.caching(VS.100).aspx
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0