Cache question

  • Thread starter Thread starter sonny
  • Start date Start date
S

sonny

Does the Cache object work in a webfarm with SessionState being?

Is there a better way to store application wide data?

thx...sonny
 
Cache is machine specific. If you are working with a webfarm, you will need
to use an appropriate service on at least one of the farm machines to handle
caching "across the farm". There is a nice .NET implementation of Memcached
server that you can find on codeplex.com, along with Session and Cache
managed provider code.
--Peter
 
Thanks Peter, I'll check it out.

A follow up question, does the same go for the Application object?
 
Yes, pretty much any ASP.NET object (Cahce, Application,...) will not be
shared between different machines.

Session is the only exception and only if you configure to be shareable (ie
use SQL server, or Session State service).

You need to use something custom written to share application stored
variables. Peter mentioned Memcached server on codeplex.com . I would start
there (although never worked with it).

George.
 
Back
Top