473,385 Members | 2,014 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,385 software developers and data experts.

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 1976
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Daniel Walzenbach | last post by:
Hi, I need to cache infrequently changed data used by the entire application. Does anybody know whether using Application state (Application = somevalue;) or the Cache API (Cache.Insert) is...
2
by: Harry Simpson | last post by:
If anyone can chime in on these questions, I'd sure appreciate it. 1. How does the cache block fit in with the UIP Block - Is the "state" managed there handled any differently with the CAB...
9
by: Joe Fallon | last post by:
If I add an instance of an object to the Cache what is returned when I request the item from the cache? Is it a clone of the object or is it a reference to the object? I want to know because I...
5
by: eXseraph | last post by:
In application state, we need to use "Application.Lock()" before we write something into Application. My question is do we need use "Application.Lock()" to LOCK the cache before we write into Cache?
2
by: LeAnne | last post by:
My question is to do with scalability and the location for storate of cache, session, viewstate and application data. Application - Data is stored in memory (in process) Session - Data is stored...
4
by: PenguinPig | last post by:
I have googling some page, and it hasn't mention the resource usage of the server in Application class and Cache class, which one consume more server resource? Thanks
0
by: dities13 | last post by:
Hello all and thank you for your time. We have a 3rd party application written for my office (vb.net 2.0 framework). However, we are getting reports of slow response time and do not believe it...
1
by: dities13 | last post by:
Hello all and thank you for your time. We have a 3rd party application written for my office (vb.net 2.0 framework). However, we are getting reports of slow response time and do not believe it...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.