asp.net caching expiration problem

Discussion in 'ASP .Net' started by ibiza, Aug 12, 2006.

  1. ibiza

    ibiza Guest

    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
    ibiza, Aug 12, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hypo
    Replies:
    6
    Views:
    388
  2. Troy Simpson

    Fragment Caching inside page caching?

    Troy Simpson, Jan 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    761
    Troy Simpson
    Jan 19, 2004
  3. Snig

    Session Expiration in ASP.NET

    Snig, Apr 14, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    8,959
    Hans Kesting
    Apr 15, 2005
  4. Timo
    Replies:
    2
    Views:
    2,819
  5. JimLad
    Replies:
    3
    Views:
    896
    JimLad
    Jan 21, 2010
Loading...

Share This Page