473,396 Members | 1,724 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,396 software developers and data experts.

Problem with caching

hth
Hi

I usually check the key and value in my cache with following code:

foreach (DictionaryEntry objItem in Cache)
{
lblCache.Text += "<li>" + objItem.Key;
lblCache.Text += "=" + objItem.Value.ToString();
}

but if I change my web.config file and save it, the code above that had
give me expecting result, give me noting.
Does someone know why this is happening and if there is a way around
it?

Helgi

Nov 19 '05 #1
2 1043
hth wrote:
Hi

I usually check the key and value in my cache with following code:

foreach (DictionaryEntry objItem in Cache)
{
lblCache.Text += "<li>" + objItem.Key;
lblCache.Text += "=" + objItem.Value.ToString();
}

but if I change my web.config file and save it, the code above that
had give me expecting result, give me noting.
Does someone know why this is happening and if there is a way around
it?

Helgi


When you change web.config, the application is restarted.
That's why the Cache (and Application and Session) is empty.
There is no way around it, except to use a database (or file)
to store those items, but that's not how tou want to use a cache.

Especially with Cache it's best to accept that values may be missing:
try if it's there. If so, fine. If not, (re)create that value (or object)
and store it for the next time.

Hans Kesting
Nov 19 '05 #2
Hi,
The reason i think is
When you are saving the web.config after making changes it causes the
application to restart.. And cache data is not persisted across application
restarts.. and hence you are losing information in the cache..
I think this is a very useful tip if you have to make changes to the
web.config and still not loose cache data
http://www.devx.com/vb2themax/Tip/18880

--
The best
srini
http://www.expertszone.com
"hth" wrote:
Hi

I usually check the key and value in my cache with following code:

foreach (DictionaryEntry objItem in Cache)
{
lblCache.Text += "<li>" + objItem.Key;
lblCache.Text += "=" + objItem.Value.ToString();
}

but if I change my web.config file and save it, the code above that had
give me expecting result, give me noting.
Does someone know why this is happening and if there is a way around
it?

Helgi

Nov 19 '05 #3

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

Similar topics

0
by: Jill | last post by:
I found out that one of my other windows with asp enabled hosting companies does not have this problem. I talked with the tech and they said they do have the asp pages caching enabled. I walked...
2
by: RipTide | last post by:
Background: Using an unsupported/abandoned multi-user multi-database program that uses Access 97 and Jet 3.5. Program itself appears to have been built with PowerBuilder 6.5. Databases reside on...
4
by: Gav | last post by:
Hi all, I'm having this strange problem where, in a web app, I have 2 different links to a different form. One is just a straight forward link the other is a bit more complicated because it gets...
4
by: Richard | last post by:
Hello, I'm dynamically writing out a web page using response.write. The page has images and hyperlinks (each hyperlink points back to the same page, but with a different parameter which...
0
by: Troy Simpson | last post by:
Hi, I have a website which is made up of dynamic pages. Each page that's loaded has some code which looks at which template to load amongst other things, which causes the page to take a little...
2
by: Mike Sobeiski | last post by:
Hi There! I'm developing a web project that requires to produce charts off the database and output it as image and presented to the user in a HTML document. (NOTE: Image is not directly...
1
by: Michael Bray | last post by:
Ok guys here's a tough one... I have a client/server application that uses remoting for communication. I am using Activator.GetObject to create a remoting instance with an URL that specifies the...
102
by: hug | last post by:
www.webmaster, was suggested that this ng could be a better place.] I've updated my test server to handle if-modified-since. I've noticed that the (old copies I run of) IE and Netscape seem...
10
by: StephQ | last post by:
I found that old post: http://groups.google.com/group/comp.lang.c++/browse_frm/thread/3a2562c9a5f8998/15519204726d01e8?lnk=gst&q=vector+no+surprise&rnum=2#15519204726d01e8 I just erased the...
3
by: paulus4605 | last post by:
dears since I'm new to ruby I try to create a form within ruby on rails. this is my controller require "player" class SpelersController < ApplicationController def index @speler =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.