multiple cache instances?

W

W. Jordan

Hello,

I would like to instantiate multiple Cache instances within my
web application, for instance, one for database related items,
one for application configuration items, one for user preferences
items, and etc.

Is it ok to instatiate multiple Cache instances by calling
the constructor method of Cache

Cache databaseCache = new Cache ();
Cache userPreferencesCache = new Cache ();
Cache configurationCache = new Cache ();

and then put them into a IDictionary colleciton for later use?

I looked up the documentation, however it warns me it is "not
suitable to use directly in code" things.

Any opinions??

Thanks,

W. Jordan
 
K

Karl Seguin

I'd had to say "no" to this. The Cache object is a made a singleton when an
appDomain loads up and should probably be kept that way. Having said that, I
really don't see why you can't accomplish the same thing with a single cache
object.

Karl
 

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

Top