|
|
|
start date: Thu, 16 Aug 2007 09:59:15 -0400,
posted on: microsoft.public.dotnet.framework.aspnet
back
| Thread Index |
|
1
Max2006 am
|
|
2
Göran Andersson
|
|
3
Braulio Diez
|
|
4
(Steven Cheng[MSFT])
|
Is Page.Cache shared between all sessions?
Hi,
Is Page.Cache global and shared between all session? What would be the best
way to cache an object and share it btween all sessions?
I like to avoid Application object because it doesn't have Cache's
flexibilities.
Thank you,
Max
Date:Thu, 16 Aug 2007 09:59:15 -0400
Author:
|
Re: Is Page.Cache shared between all sessions?
Max2006 wrote:
> Hi,
>
> Is Page.Cache global and shared between all session?
Yes.
> What would be the best
> way to cache an object and share it btween all sessions?
> I like to avoid Application object because it doesn't have Cache's
> flexibilities.
>
> Thank you,
> Max
>
>
--
Gran Andersson
_____
http://www.guffa.com
Date:Thu, 16 Aug 2007 19:24:19 +0200
Author:
|
RE: Is Page.Cache shared between all sessions?
Yes,
Cache should be shared around sessions (not sure in a farm of servers).
If you want you can make a dummy test:
- Add a Page cache of 30 minutes that read a value from a table in
database
- Open an IE an Access the page (it should be cached).
- Modify that value from the DB
- Open another IE sessions and you will get the page without the labe
updated from the DB.
HTH
Braulio
/// ------------------------------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ------------------------------
"Max2006" wrote:
> Hi,
>
> Is Page.Cache global and shared between all session? What would be the best
> way to cache an object and share it btween all sessions?
> I like to avoid Application object because it doesn't have Cache's
> flexibilities.
>
> Thank you,
> Max
>
>
>
Date:Thu, 16 Aug 2007 18:06:55 -0700
Author:
|
RE: Is Page.Cache shared between all sessions?
Hi Max,
Yes, you Page.Cache is shared among all the sessions, actually Page.Cache
is just HttpContext.Cache which is a global storage available within the
entire ASP.NET application scope(AppDomain). And it is a good place to
store some global data since it also provide some cachepolicy to make cache
item expired(such as File based, Database based or timespan based ....)
http://www.codeproject.com/aspnet/exploresessionandcache.asp
Also, other means for share objects within application scope include:
** store object/data in database
** use a public class's static member variables to hold objects
static member variable is useful for simple data caching scenario and you
need to take care of the concurrent accessing and update of the data in
shared static members.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Fri, 17 Aug 2007 02:14:05 GMT
Author:
|
|
|