Why is cache disappearing?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an application that I recently converted to 2.0 from 1.1. This
application is relying on data stored at HttpContext.Current.Cache. When I
run in 1.1 the data stays available in the cache, but when I run the 2.0
converted application, once I change pages, the cache is emptied. Is this
just a setting that I am missing, or has something changed about the way that
the cache is managed?
 
Hi,

sounds like there would happen more application restarts which essentially
restart the appdomain ( and clear cache). What do you mean by "once I change
pages"?
 
the cache is a true cache. if memory contraits or dependecy changes occur,
its flushed. so you need to always check if its in the cache first, if not
create the object.

-- bruce (sqlwork.com)
 
Whether it is a Server.Redirect to a different page on my site, or simply a
postback to the same page, the Cache is cleared. If I access the cache
multiple times in the same request, it does hold the values throughout that
one request, though.
 
Right, I am already doing that, but why is it flushing data that I want to
keep in 2.0, where it did not when this project was 1.1? The only thing that
has changed is that it is now built in Visual Studio 2005 and runs under the
ASP.Net 2.0 framework.
 
OK, I had to reset IIS a couple of times because my development environment
was freezing up, and now the cache is not getting lost. Should I just let
this go, or is it something that I should be concerned with?
 
Back
Top