Note that there are some explanatory texts on larger screens.

plurals
  1. POOne Cache for various Applications?
    text
    copied!<p>i have two applications - one is an asp.net website and the other is a windows service.</p> <p>both applications are referencing my business layer (library project), which itself is referencing my data access layer (library project) that itself uses the enterprise library data application block to receive the data form a sql server 2005 database.</p> <p>currently i use the System.Web.Caching.Cache object in my BL to cache some of my objects:</p> <pre><code>public static System.Web.Caching.Cache Cache { get { if(cache == null) { if (System.Web.HttpContext.Current != null) { //asp.net cache = System.Web.HttpContext.Current.Cache; } else { //windows service cache = System.Web.HttpRuntime.Cache; } } return cache; } } </code></pre> <p>as both applications are running on their own - they both are using a separate Cache object on their own - and this is the problem actually:</p> <p>if i change a object in the asp.net website and save it to the DB. the object to this cache key is removed from the cache - the asp.net application's cache! that's fine.</p> <p>but the windows service's Cache becomes stale!</p> <p>vice-versa</p> <p>is it possible that both applications are using the same Cache? One Cache for both applications?</p> <p>the only option i have i think about is that i will have to use SqlDependency with </p> <blockquote> <p><a href="http://quickstarts.asp.net/QuickStartv20/aspnet/doc/caching/SQLInvalidation.aspx" rel="nofollow noreferrer">Sql Server 2005 Notification-based Cache Invalidation</a></p> </blockquote> <p>is there any other way?</p> <p>EDIT: i just found <a href="http://www.codeplex.com/SharedCache" rel="nofollow noreferrer">http://www.codeplex.com/SharedCache</a>. i will give it a try. as because velocity will be in release candidate status until mid 2009.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload