all groups > asp.net caching > april 2005 >
You're in the

asp.net caching

group:

ASP.Net caching in web garden scenario


ASP.Net caching in web garden scenario mk
4/15/2005 2:47:02 PM
asp.net caching:
if we configure an ASP.Net application pool with more than one worker process
(web garden), they do not share session object, application object or ASP.net
intrinsic cache object. If I want all these processes to share one single
cache, is it possible to configure at all some way or the other?

My problem is I am using Application (HttpApplicationState) object for
caching. And if this not going to be shared across worker processes in an
application pool, then when I have to invalidate some entries in cache as the
data is not valid any more, I cannot delete entries in all caches at one
time. Only the worker process that handled the request would clear its cache
entries and the rest of the processes still have invalid data.



What is the best way handling this scenario?

Re: ASP.Net caching in web garden scenario Alvin Bruney [MVP - ASP.NET]
4/15/2005 7:51:23 PM
You can implement a notification system that basically notifies all the
cache objects in the garden to refresh themselves. I've seen this
implemented, but it was prone to failure.

If you architecture is that complicated, you need to move cache to a
database or a queue system

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc
[quoted text, click to view]

Re: ASP.Net caching in web garden scenario Brock Allen
4/16/2005 4:29:52 AM
The problem is that each application in IIS is a seperate AppDomain in .NET
and objects in .NET are scoped to AppDomains, meaning an object (or a cache
object, for example) can't span the AppDomain boundary. You'll have to build
your own custom cache.

-Brock
DevelopMentor
http://staff.develop.com/ballen



[quoted text, click to view]


Re: ASP.Net caching in web garden scenario mk
4/18/2005 6:20:03 PM
Thanks for your time!

I am thinking about creating a CacheDependecy (some file) at the web server
root level so that all worker processes can access.

And in my code, I am planning to cache all my objects in ASP.Net cache
rather than application cache and add that file as a cache dependency for all
cache objects. And to clear all cache entires, I will change the timestamp of
the file at web server level and hoping it would clear all the entries in all
caches (in all worker processes).

Is this design going to work and if it works are there any known flaws with
this design?

Thanks,
MK


[quoted text, click to view]
Re: ASP.Net caching in web garden scenario mmtltd
11/15/2005 6:26:00 AM

Hi - I'm thinking about the same design as we have two web servers
sharing session state but not caching. It is exactly the same problem -
it's mainly invalidating caches that we need a solution for for instance
if data gets modified one server will still hold a cached old copy.

Did you get anywhere with this design?



--
mmtltd
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------
AddThis Social Bookmark Button