Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Caching / November 2005

Tip: Looking for answers? Try searching our database.

ASP.Net caching in web garden scenario

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mk - 15 Apr 2005 22:47 GMT
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?
Alvin Bruney [MVP - ASP.NET] - 16 Apr 2005 00:51 GMT
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

Signature

Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc

> if we configure an ASP.Net application pool with more than one worker
> process
[quoted text clipped - 13 lines]
>
> What is the best way handling this scenario?
mk - 19 Apr 2005 02:20 GMT
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

> You can implement a notification system that basically notifies all the
> cache objects in the garden to refresh themselves. I've seen this
[quoted text clipped - 20 lines]
> >
> > What is the best way handling this scenario?
mmtltd - 15 Nov 2005 12:26 GMT
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?


Brock Allen - 16 Apr 2005 12:29 GMT
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

> if we configure an ASP.Net application pool with more than one worker
> process (web garden), they do not share session object, application
[quoted text clipped - 11 lines]
>
> What is the best way handling this scenario?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.