Solved

how does it work ???

Posted on 2008-10-20
6
168 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
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…

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now