Browser cache problems when accessing PHP files with Mootools' SqueezeBox
Question
I am using Squeeze Box to access a PHP file which prints an alert for the user based on the link clicked (i.e. PHP file uses $_GET variable).
The problem is when I click once the alert box open correctly but when I click the link again, the result appears twice i.e. it duplicates itself and the results continue replicating each time the link is clicked.
But when I close the browser, the problem restarts again, is there a solution for this problem. (And the problem appears in both Mozilla and IE)
Thanks
Solution
not familiar with squeezebox but there are normally a few tactics for this.
- switch to
$_POST
not$_GET
- append a random querystring to each request - e.g. a timestamp
- add no-cache headers to PHP file.
no-cache would look something like this:
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow