I have two applications: one is an asp.net site and the other is a windows service.
both applications link to my business layer (library project), which itself refers to my data access layer (library project), which itself uses the corporate library data application block to retrieve the data form from the SQL Server 2005 database.
I am currently using the System.Web.Caching.Cache object in my BL to cache some of my objects:
public static System.Web.Caching.Cache Cache { get { if(cache == null) { if (System.Web.HttpContext.Current != null) {
since both applications work independently - they both use a separate Cache object on their own - and this is actually a problem:
if I modify an object on asp.net website and save it to the database. the cache key object is removed from the cache - asp.net application cache! it's good.
but the windows service cache is becoming obsolete!
vice versa
Is it possible that both applications use the same Cache? One cache for both applications?
The only option I think of is that I will have to use SqlDependency with
Sql Server 2005 Invalid Notification Cache
Is there another way?
EDIT: I just found http://www.codeplex.com/SharedCache . I will give it a try. since the speed will be in the status of a candidate for release until mid-2009.
source share