Solved

how does it work ???

Posted on 2008-10-20
6
169 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
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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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 200 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

786 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