I have a page, index.php, that shows information based on a mysql db. There are forms on it, and the action for the forms is set to a separate page called process.php. Pro
<?php header("Cache-Control: no-cache, must-revalidate");
Make all browsers fall in line:
header("Location: /webadmin/email/index.php?r=".mt_rand(0, 9999999));
It's not pretty, but it fits the question asked: "How to force..."
This is the correct order to get it working on all browsers:
<?php
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Pragma: no-cache"); // HTTP/1.0
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
?>
Try fooling the browser with a spurious querystring:
header("Location: /webadmin/email/index.php?x=1");
I would play safely and try to output all cache killers known to man (and browser). My list currently consists of:
<?php
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>
<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>
do this and it should prevent caching in all browsers
tested in IE FF and chrome