If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > solving Asp Shopping basket Cache problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-18-04, 02:48
Akumaownz Akumaownz is offline
Registered User
 
Join Date: Dec 2003
Posts: 10
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???
Reply With Quote
  #2 (permalink)  
Old 04-19-04, 00:23
Bullschmidt Bullschmidt is offline
Guru
 
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
Reply With Quote
  #3 (permalink)  
Old 04-19-04, 02:58
Akumaownz Akumaownz is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On