Application or Cache

S

stefano mostarda

Hi there,

I have a question.

In my application I have a table which is frequently used to fill a combo. I
want to store it in the application or cache object. it is never updated.

What's the besta container to improve performance and scalability, Cache or
Application object?

Thanks in advance
Stefano Mostarda
Rom Italy
 
J

Janaka

Stefano,

You can store this in either really. If you use the Cache though you can
set a sliding scale expiration, for say an hour, so that its not using up
resources when not in use.

Janaka
 
K

Kevin Spencer

The Cache is the best place to store whatever you need. It is thread-safe,
for one thing.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.
 
A

Alvin

Also application was provided for backward compatibility with asp classic
and shouldn't be used going forward

regards
 
J

Jeff

Using the cache does require a little more work (but it is worth it).
Basically, in your code, you read the cache. If you don't find the item,
you have to build it and then load it into the cache. You cannot assume
that the item will always be in the cache. This is because ASP.NET will
start deleting items from the cache if it starts running out of memory.

Once you get used to coding this way, it is pretty easier. And the Cache
object is much more flexible than the Application object ever was.

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top