473,382 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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
Aug 16 '07 #1
3 1395
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


--
Göran Andersson
_____
http://www.guffa.com
Aug 16 '07 #2
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
Aug 17 '07 #3
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/ex...onandcache.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.

Aug 17 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Flavio Ribeiro | last post by:
Hi, Most of my application's operations (including SQL queries and numerical computation) can be cached. An LRU (least recently used) cache would fit the bill perfectly. This LRU cache should...
21
by: Bill H | last post by:
I have a routine that displays 60 items (with thumbnails) per page. You can click any item and displays a new page with item details. When the user back pages it runs the query again to display all...
3
by: Keith Patrick | last post by:
I have an app (A) that has a link to another (B) app that it spawns in a new window. The new window has a link back to app A, opening a third window (let's call it A2). The problem is, I need A2...
3
by: Peter Theill | last post by:
Hi, I'm trying to include the content of a request into an Xml document: if (System.Web.HttpContext.Current.Session != null) { XmlDocument d = new XmlDocument(); d.Load(new...
3
by: Janaka | last post by:
Hi All, I'm having a problem with Page Output caching on a page that contains a DataGrid. Basically the page pulls up some data for sales information from the DB. Some of this has to be...
2
by: Harry Simpson | last post by:
If anyone can chime in on these questions, I'd sure appreciate it. 1. How does the cache block fit in with the UIP Block - Is the "state" managed there handled any differently with the CAB...
7
by: py | last post by:
how feasible is it to cache an entire page's content in a session variable? i am already doing it and it works fine, except i am afraid of scalability issues. what is the best way to test this? ...
4
by: Vasantha peddireddy | last post by:
I am posting a page to another page (form post). The data grid on the second page is being populated with data. Now, on page load of the second page, I would like to send the grid data on this page...
5
by: Max2006 | last post by:
Hi, Since Application collection and Page.Cache can be shared among all sessions, I wonder if they are thread safe? Thank you, Max
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.