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
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