Application Cache and Session are equally useful, both when used correctly.
Anyone that tells you not to use Session probably doesn't know how to use it
properly. The real issue is one of scope. Sessions, as Steve said, are
user-specific, and global to all pages for a given specific user.
Application Cache is global and non-user-specific. Application Cache data
can be accessed in any page or class in the Application, and by every user.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
[quoted text, click to view] "Robir" <RGustavirssen@nospamWirnbergessen.org> wrote in message
news:uDU6c1$BEHA.3804@TK2MSFTNGP09.phx.gbl...
> When is it better to store a small amount of data (say a very small
DataSet
> or a couple of short string variables) in the Session vs in the Cache
> object. I've had it recommended to store such things in the Cache and to
> simply stay away from the Session as a general rule. But as far as I know,
> storing data in the Cache puts your data at risk in that the system might
> determine that the data should be purged because the system thinks it's
okay
> to simply because it hasn't been accessed for a while. I understand that I
> can create some callback logic that will automatically re-create the data
> just purged from the Cache by the system - but that's a lot of work. Am I
> correct in thinking that if I store it in the Session that I don't have to
> worry about the system purging it as it would if the same data were in the
> Cache? If that is correct, then what's the big benefit of storing duch
data
> in the Cache if I have to worry about the system purging it. Doesn't the
> Cache also have the same scope/lifetime as the Session?
>
> Thoughts? Perspective? Opinions?
>
> TIA
>
>