asp.net caching expiration problem

I

ibiza

Hi, I am trying to use ASP.NET caching like that :

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Not (Cache("test") Is Nothing) Then
Response.Write(Cache("test"))
Else
Cache.Insert("test", "woot woot", Nothing,
Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(5))
Response.Write("Cache initialized")
End If
End Sub

It works well, except for the expiration. When Cache("test") is being
initialized and I hit refresh, it shows "woot woot", but only for a few
seconds (I keep hitting F5). Whatever number I put instead of 5 doesn't
change a single thing, nor if I try New TimeSpan(0, 5, 0) instead of
TimeSpan.FromMinutes(5)

Am I doing anything wrong?

thanks
 

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

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top