> How do people feel about caching commonly used tables (ie. an
> organizational
> structure for instance) at the application level in an ASP.Net project
-
> does this have any catches (other then data getting stale over time
and
> the
> initial population cost) - I've got plans for doing this with a number
of
> business objects (rather then the datasets) for an upcoming
application
> where performance is the biggest concern.

Caching commonly used tables as datasets at the application level is a
great way to reduce round trips to the DB server in a web app. Just make
sure you use the Cache object to cache them, not the Application state
bag. With the cache object, you can specify a timeout after which time
you will be forced to re-load the data, which is a nice way of dealing
with stale data.

> Any feedback would be well appreciated as I'm embarking into this
> territory
> for a largeish project quite soon *g* - are there any threading issues
> with
> two applications accessing the same cached object in a websites
> application?

The Cache uses a multi-reader/single-writer lock, so it is safe to
access concurrently, and it won't slow you down (like the
application-wide lock on the Application state bag will) for concurrent
reads.

        -Fritz


Fritz Onion
DevelopMentor
http://staff.develop.com/onion/

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to