Home > Item #168
I have a customer who has a problem with adding items to the CactuShop basket. Everytime he adds an item to the basket, it refreshes with nothing in it! I have other clients who are using the shop successfully. What is happening?
This is most likely a cache problem. Pages can be stored on disk so that when the user accesses the page again, the stored version is served back instead of using bandwidth getting the page a second time.
Caching can occur both within the browser (check browser settings) and also at proxy servers, but ASP pages are generally not cached because they are dynamic.
Try adding these lines to the config.asp file, around line 44:
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.AddHeader "cache-control","private"
Response.Expires = 60
Response.Expiresabsolute = Now() - 2
It is still possible that a proxy server or browser could be set to override these 'no cache' commands, but the code should eliminate most problems. These lines were incorporated into CactuShop as default from v4.506 onwards but this caused problems with accessing pages in the history, so they were removed. They are however a good test that caching is the problem.
If you add these lines, the cached pages will still remain. So you need to clear your browser cache and any other caches along route.
Ensure your browser is not set to cache ASP pages.