?
Solved

how does it work ???

Posted on 2008-10-20
6
Medium Priority
?
173 Views
Last Modified: 2012-05-05
Hi,
   I have a situation as follows :

I have a bunch of my website settings which i named it as WebSettings (a class which holds all these settings).

I create object of this class on first call and store it in Cache object for all future uses.


Now one browser is accessing the Value of a particular setting from Cache.

Meanwhile i changed the system setting value and new browser is opened to access the setting.

My question is is there 2 different copies of Cache available for 2 browser instances or Cache would be same.
0
Comment
Question by:Paramhans
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 15

Expert Comment

by:angus_young_acdc
ID: 22765265
From memory you would have to create two seperate caches, otherwise it will all be stored in 1 default cache where if one browser changes a value (and stores it in the cache) then the 2nd browser would read the updated value.
0
 
LVL 13

Expert Comment

by:crazyman
ID: 22765357
This depends on how you are storing it, i presume your using HttpContext.Current.Cache.
What are you using as the Key ?
0
 
LVL 6

Expert Comment

by:AmarIs26
ID: 22765359
Cache is global just like Application object. It is optimised for faster and safer read/write. So if you need to store something that will be used by all users then use cache. However if you need to use settings which are per user, then you should make use of the Session which is user specific.

1 Cache -> Shared by All browsers/users
1 Session -> Shared by one user/ One unique instance of the browser
1 Application -> Shared by all browsers/users
0
Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

 
LVL 2

Expert Comment

by:johnhumenik
ID: 22773425
It might be ok to use a database table and store the settings there.  If you wanted to keep the settings the same across all instances of your application you would just load the data everytime from the database.  You could version the data or setup temp areas where settings can change on a per user basis or allow global changes.  That way you have complete control over the data and can even load that data into a memory (class / struct) as needed.  
0
 

Author Comment

by:Paramhans
ID: 22793650
Hi thanx 4 the replies.

But to be very precise i want answer to my question.

My question is is there 2 different copies of Cache available for 2 browser instances or Cache would be same.

thanx in advance
0
 
LVL 6

Accepted Solution

by:
AmarIs26 earned 600 total points
ID: 22794121
The httpcache would be the same for two browser instances. A unique instance is when you open ie twice from windows. If you open a new window from existing browser window then that is not unique instance.
Anyways, cache will be same for two browser in stances.
Session will be different for two browser instances.
if you still wanted to use cache then you could use the sessionid as key for your cache data
sessionID+key = keyfor cache.
0

Featured Post

Give Your Engineering Team a Productivity Boost

Learn why container technology is so powerful and how it can provide your team with productivity gains and other benefits.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question