HighTechTalks DotNet Forums  

Cache.Remove() in a clustered environment

ASP.net Caching microsoft.public.dotnet.framework.aspnet.caching


Discuss Cache.Remove() in a clustered environment in the ASP.net Caching forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Dale
 
Posts: n/a

Default Cache.Remove() in a clustered environment - 07-12-2005 , 03:06 PM






In a clustered environment does Cache.Remove() kill all instances of the
cache item, or does it just kill the item from the box that the code is
currently executing on?

For example, suppose I have two boxes within a cluster. If a request gets
served up to Box 1, and Cache.Remove(foo) is executed, does foo get removed
from both Box 1 and Box 2, or just Box 1.

Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default RE: Cache.Remove() in a clustered environment - 07-12-2005 , 10:06 PM






Hello,

The Cache object is restricted to being used only within an application
running on a single machine. Therefore, I think Cache.Remove() only
remove cached objects on one server.

Luke


Reply With Quote
  #3  
Old   
Alvin Bruney [MVP - ASP.NET]
 
Posts: n/a

Default Re: Cache.Remove() in a clustered environment - 07-13-2005 , 09:53 AM



that's correct

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
"[MSFT]" <lukezhan (AT) online (DOT) microsoft.com> wrote

Quote:
Hello,

The Cache object is restricted to being used only within an application
running on a single machine. Therefore, I think Cache.Remove() only
remove cached objects on one server.

Luke




Reply With Quote
  #4  
Old   
TomislaW
 
Posts: n/a

Default Re: Cache.Remove() in a clustered environment - 07-14-2005 , 11:18 AM



so how to easy migrate asp.net project that uses cache and session objects
from single server to cluster servers?

"Alvin Bruney [MVP - ASP.NET]" <www.lulu.com/owc> wrote

Quote:
that's correct

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
"[MSFT]" <lukezhan (AT) online (DOT) microsoft.com> wrote in message
news:roKHI%230hFHA.944 (AT) TK2MSFTNGXA01 (DOT) phx.gbl...
Hello,

The Cache object is restricted to being used only within an application
running on a single machine. Therefore, I think Cache.Remove() only
remove cached objects on one server.

Luke






Reply With Quote
  #5  
Old   
Dale
 
Posts: n/a

Default RE: Cache.Remove() in a clustered environment - 07-15-2005 , 02:16 PM



Thank you very much for your response. This explains a lot.

Do you know where I could find some information, or possibly sample code,
that would clear the Cache for all servers in the cluster. The only way I can
think of is to actually run Cache.Remove() on each server. That would force
me to find a way to make a request to each server. It seems like there must
be a more elegant solution.


"[MSFT]" wrote:

Quote:
Hello,

The Cache object is restricted to being used only within an application
running on a single machine. Therefore, I think Cache.Remove() only
remove cached objects on one server.

Luke



Reply With Quote
  #6  
Old   
Alvin Bruney [MVP - ASP.NET]
 
Posts: n/a

Default Re: Cache.Remove() in a clustered environment - 07-16-2005 , 08:53 AM



Yup, that's pretty much it. Or another cheesy way is to force an application
pool recycle. You can actually generate the recylce thru a script app that
runs on the servers. If you google, you should be able to find the app pool
recycle script.

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
"Dale" <dale (AT) noemail (DOT) nospam> wrote

Quote:
Thank you very much for your response. This explains a lot.

Do you know where I could find some information, or possibly sample code,
that would clear the Cache for all servers in the cluster. The only way I
can
think of is to actually run Cache.Remove() on each server. That would
force
me to find a way to make a request to each server. It seems like there
must
be a more elegant solution.


"[MSFT]" wrote:

Hello,

The Cache object is restricted to being used only within an application
running on a single machine. Therefore, I think Cache.Remove() only
remove cached objects on one server.

Luke





Reply With Quote
  #7  
Old   
Alvin Bruney [MVP - ASP.NET]
 
Posts: n/a

Default Re: Cache.Remove() in a clustered environment - 07-16-2005 , 08:54 AM



Firstly, you are limited by the technology. If you need to share cache in a
cluster, it needs to be in the database or in a third party application that
makes this functionality available.

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
"TomislaW" <tomislav147 (AT) hotmail (DOT) com> wrote

Quote:
so how to easy migrate asp.net project that uses cache and session objects
from single server to cluster servers?

"Alvin Bruney [MVP - ASP.NET]" <www.lulu.com/owc> wrote in message
news:eUP6RJ7hFHA.1248 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
that's correct

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
"[MSFT]" <lukezhan (AT) online (DOT) microsoft.com> wrote in message
news:roKHI%230hFHA.944 (AT) TK2MSFTNGXA01 (DOT) phx.gbl...
Hello,

The Cache object is restricted to being used only within an application
running on a single machine. Therefore, I think Cache.Remove() only
remove cached objects on one server.

Luke








Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.