I need to prevent caching of a page, to ensure that it always displays the latest data. I have done this by adding some PHP at the top of the page.
//Set no caching
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
It has overcome the immediate problem, but I am not sure if this means that external scripts are also having to be reloaded every time. The page uses jquery, jquery-ui and some other scripts so it would be nice to avoid reloading them for the benefit of users with a slow connection.
Do those headers force everything to reload or just the actual code on the page?