Ajax returns stale data

Discussion in 'Databases' started by Sleeping Troll, Jul 23, 2008.

  1. #1
    If I run this asp directly via url it picks up any newly added records.
    <!-- #include file = "DSN.asp" -->
    <%
    Set rs=Server.CreateObject("ADODB.RecordSet")
    rs.CursorType = 2
    rs.ActiveConnection = conn
    rs.open ("SELECT top 1 time FROM calls INNER JOIN cliente INNER JOIN p1 ON cliente.id_cli = p1.clie INNER JOIN p2 ON p1.id_p1 = p2.p1 INNER JOIN p3 ON p2.id_p2 = p3.p2 INNER JOIN p4 ON p3.id_p3 = p4.p3 ON calls.number = p4.c2 WHERE(cliente.id_cli = 30) order by time desc")
    Resp = rs.fields("time")
    rs.close
    Set rs = nothing
    conn.close 
    Response.Write(Resp)
    %>
    Code (markup):
    However if I call it from client, data is stale (will not pick up newly added records)
     
    Sleeping Troll, Jul 23, 2008 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    My guess is that either your web server or the database is caching the results. I don't use ASP but I think that it and your database have the ability to cache results which would have the effect that you are seeing.
     
    jestep, Jul 23, 2008 IP
  3. Sleeping Troll

    Sleeping Troll Peon

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You are correct the information I can find indicates that I can set cache to refresh on query, however neither my client or I have the knowledge to do that, can you help?
     
    Sleeping Troll, Jul 23, 2008 IP