differencies between cache and session

  • Thread starter Thread starter sizheng
  • Start date Start date
It can be confusing, as the cache object is on first sight very similar to
the Application and Session object and contains a simple key/value pair
dictionary model. Unlike Application or Session, items within the Cache can
expire. The cache also supports file, key, and time based dependencies, as
well as callbacks.

Simply put Session data is not time dependent, cache data is. Therefore the
session and its contents persists while the user session remains active,
while the cached content may expire while the user still has a session
active. Data in the cache is responsive to changes in its dependencies - ie
the cached file contents changing would cause the cache to flush and reload
its data. So, the session is really for storing simple objects that are
neither time dependent nor have dependencies that can be outside the control
of the web application.

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
 

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

Back
Top