By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,695 Members | 1,310 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,695 IT Pros & Developers. It's quick & easy.

Cache to store persistent application's variables

P: n/a
NWx
Hi,

Is Cache appropriate to store persistent variables used across the
application? What I want is to store UserID for currently logged user,
SessionID (my own SessionID, which keep track of datetime for login and
logout as well as other info, like Client IP , etc)

My objects I want store to cache are not set-up to expire.

Or should I store them better in Session storage?

Regards
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Small user specific values are probably better stored in the session object.
I would use the cache for more broader used values (application wide). In
particular I believe that when storing in the cache you should be always
prepared for cache misses (under low memory condition, I believe even
"permanent" items may be destroyed. Can someone confirm this ?

In any case you may want to provide a class that store/retrieve these
values, this way you'll be easily able to change the underlying storage for
these values (plus type safety, intellisence for user settings etc...)

Patrice

--

"NWx" <te**@test.com> a écrit dans le message de
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi,

Is Cache appropriate to store persistent variables used across the
application? What I want is to store UserID for currently logged user,
SessionID (my own SessionID, which keep track of datetime for login and
logout as well as other info, like Client IP , etc)

My objects I want store to cache are not set-up to expire.

Or should I store them better in Session storage?

Regards


Nov 18 '05 #2

P: n/a
NWx
Hi,

Your suggestion about packing saving / restoring to a class is great. I'll
use it, thnaks.

Regards

"Patrice Scribe" <no****@nowhere.com> wrote in message
news:e7**************@TK2MSFTNGP11.phx.gbl...
Small user specific values are probably better stored in the session object. I would use the cache for more broader used values (application wide). In
particular I believe that when storing in the cache you should be always
prepared for cache misses (under low memory condition, I believe even
"permanent" items may be destroyed. Can someone confirm this ?

In any case you may want to provide a class that store/retrieve these
values, this way you'll be easily able to change the underlying storage for these values (plus type safety, intellisence for user settings etc...)

Patrice

--

"NWx" <te**@test.com> a écrit dans le message de
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi,

Is Cache appropriate to store persistent variables used across the
application? What I want is to store UserID for currently logged user,
SessionID (my own SessionID, which keep track of datetime for login and
logout as well as other info, like Client IP , etc)

My objects I want store to cache are not set-up to expire.

Or should I store them better in Session storage?

Regards

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.