Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Posts
    10

    Unanswered: solving Asp Shopping basket Cache problem

    I have made a small shopping basket in asp which is having a cacheing problem. Everything works fine on the first visit to the site, you can add and remove items from the basket np but once you close the browser and the return the second time there is a phantom iteam in the basket. Once you go to the checkout it is not there. I have made a nocache.asp file
    ie
    <%
    Response.Expires = 15
    Response.ExpiresAbsolute = Now() - 2
    Response.AddHeader "pragma","no-cache"
    Response.AddHeader "cache-control","private"
    Response.CacheControl = "private"
    %>

    and included it in all my asp pages as
    <!-- #include file="nocache.asp" -->
    but the iteam still appears

    if you control F5 (clear the cache) the item dissapears

    any1 got any ideas???

  2. #2
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    This is what works for me to not have the browser cache the page:

    Response.Expires = -1000 ' Make browser not cache pg.
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

  3. #3
    Join Date
    Dec 2003
    Posts
    10

    I tried Response.Expires = -1000 '

    Bullschmidt I tried
    <%
    Response.Expires = -1000 '
    %>

    but the item got stuck in the basket and would not even remove when I cntrol f5 the page so I went back to my
    <%
    Response.Expires = 15
    Response.ExpiresAbsolute = Now() - 2
    Response.AddHeader "pragma","no-cache"
    Response.AddHeader "cache-control","private"
    Response.CacheControl = "private"
    %>
    I have found that if I do a simple f5 refreash on the page the item is removed.
    It there some code that will do a simple f5 refreash on a page when someone revisits it. I think this will solve my problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •