Shared the Cache object accross IIS Applications


C

cmay

Is there any way that 2 IIS Applications:

localhost/App1
localhost/App2

can share a Cache?

Lets say that both applications need to use the same objects
frequently, and both are storing them in Cache. Is there a way to
avoid duplicating this? Putting everything in 1 cache?
 
Ad

Advertisements

B

Bruce Barker

no, because they are in seperate app domains. you could write a cache
hosting service, that they all call, but then you would be doing out of
process marshaling (even cross domain marshaling is slow).

-- bruce (sqlwork.com)
 
Ad

Advertisements

J

john_teague

I've never tried this, so I don't know if it will work. You could
serialize your objects to a file and create a dependency on the file.
use the same file in both apps. I would create a Helper class used by
both applications and be sure and lock the object when reading and
writing so you don't have any race conditions.
This article might help.
http://msdn.microsoft.com/msdnmag/issues/04/07/CuttingEdge/

A little more searching and I found this article, which describes
exactly what I'm talking about.
http://www.eggheadcafe.com/articles/20030420.asp

Good Luck
 

Top