Cache lifetime

Neal

Forum Admin
Staff member
Joined
Jun 2, 2004
Messages
123
Location
VA
Programming Experience
10+
Okay, this one is almost funny! I am developing an asp.net application on my local system, I press the > to start the debugger and view the app, then close the browser to do more work. I have this code to cache a dataset:

Dim ds As DataSet = Cache("directory")

If Not ds Is Nothing Then

dsDirectory = Cache("directory")

Else

Me.LoadDirectoryDS(di)

Cache("directory") = dsDirectory

End If

It appears the cache object is persisting between debugging sessions. Is this true? I thought if I closed my browser it would kill the cache? What is the cache duration/liftetime then?
 

Aholics.com

Active member
Joined
Jun 15, 2004
Messages
27
Location
San Diego
Programming Experience
10+
I would think the cache would reset itself upon a rebuild? Is it possible you're not making any changes prior to debugging, thus, not really rebuilding? That would make sense to me, as the cache is stored on the server...and probably wouldn't release unless there was a rebuild.

Ya?
 

Neal

Forum Admin
Staff member
Joined
Jun 2, 2004
Messages
123
Location
VA
Programming Experience
10+
I had to do IISRESET on the local machine to get it to reset each time! Strange! (XP Pro here)
 

AmesVB

Member
Joined
Jun 14, 2004
Messages
5
Programming Experience
10+
Somewhere I have seen code to set the cache life before using it so you will know when it expires.
 

Neal

Forum Admin
Staff member
Joined
Jun 2, 2004
Messages
123
Location
VA
Programming Experience
10+
I have the cache set with a file dependancy for my situation (one of them) but the other appears that it's going to be the lifetime of the application, hence a restart, worker process timeout, etc.
 
Top Bottom