473,394 Members | 1,841 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,394 software developers and data experts.

Cache to store persistent application's variables

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

Similar topics

3
by: Aaron | last post by:
I made a web application using c#, i'm trying to port it to a windows application. but some of the functions didn't work. What is the equavelent of cache in a windows application? and how do i...
1
by: Ryan | last post by:
The real reason for my previous post about intercepting Application_EndRequest (from outside of Global.asax) is because of a need to create a "non persistent page level cache". I can't seem to...
4
by: Troy | last post by:
I keep getting this error in IIS 6.0. It causes our web application to display the "Service Unavailable" message when users attempt to visit any asp.net page. all asp pages are fine... does...
7
by: Mike | last post by:
Hi, I have an ASP.NET solution in which I need to store some information, such as DB user and password. So far, I have used the Context object to share information between the various pages, but I...
2
by: Martin | last post by:
Hi, I have been trying to find a good article that would explain the scalability of the cache and application variables accross a web farm. I believe that application variables will not scale...
3
by: MattC | last post by:
Hi, I am persisting the viewstate for each page into the Cache object, below is shown my methods for saving and loading: I am able to save the viewstate to the cache and most times I can load...
3
by: Max2006 | last post by:
Hi, Is Page.Cache global and shared between all session? What would be the best way to cache an object and share it btween all sessions? I like to avoid Application object because it doesn't...
5
by: Trapulo | last post by:
Hello, I'm developing an asp.net application that is connected to a remote system using WCF (wshttp binding). So I want to use a local cache to manage data that I receive from remote service. ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.