469,628 Members | 1,089 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,628 developers. It's quick & easy.

Cache vs Application State -- Pls help understand

Well I am quite confused with the methods out there. I would like to
understand if Cache is the best method to store freq acessed data over
application state.Currently I have pbs with the application state that it
expires and results in error.

Vishwanathan
Nov 19 '05 #1
2 1869
Cam
The general difference is that when you add an object into the Cache you can
specify options controlling how long it will stay in there. You can specify
an absolute timeout, or a sliding window.

The general algorithm you should be using (in either case) is:

if (item exists in cache)
{
use item from cache
}
else
{
re-calculate item
store item in cache
}
"Vishwanathan Raman" wrote:
Well I am quite confused with the methods out there. I would like to
understand if Cache is the best method to store freq acessed data over
application state.Currently I have pbs with the application state that it
expires and results in error.

Vishwanathan

Nov 19 '05 #2
Hi Vishwanathan, I believe your problems may result from asp.net 'going to
sleep' after a period of inactivity (or aspnet recyling its worker process).
The same problem would also occur if you were to use the cache object.

Assuming IIS6 on W2k3, you can get around this by unchecking the option
"shut down worker process after being idle for (time in minutes)" which is
defaulted to 20 mins. (IIS-->Application Pools-->(pool for your
app)-->Properties-->Performance)

A better solution would be to check whether the object exists in cache(or
application) if it doesn't recreate it and put it back into cache(or app)
then use it.

HTH jd

"Vishwanathan Raman" wrote:
Well I am quite confused with the methods out there. I would like to
understand if Cache is the best method to store freq acessed data over
application state.Currently I have pbs with the application state that it
expires and results in error.

Vishwanathan

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Daniel Walzenbach | last post: by
2 posts views Thread by Harry Simpson | last post: by
9 posts views Thread by Joe Fallon | last post: by
5 posts views Thread by eXseraph | last post: by
2 posts views Thread by LeAnne | last post: by
4 posts views Thread by PenguinPig | last post: by
reply views Thread by dities13 | last post: by
1 post views Thread by dities13 | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.