I have an HTML page that has shows if a server is online of offline via an IFRAME transcluding a php file. If someone clicks on a link, like to turn the server on or off and presses the Back button on the browser, the browser loads a cached version of the page and still displays the server as off unless the page is refreshed. I know there are other ways to go about this but I would like for just that page to not be cached so that when a user reaches that page via the Back button, it will have to redownload the page.How can this be done? Is it even possible?Putting header(Cache-Control: no-cache, must-revalidate); in the php file did not work.
Clear the cache of the last visited page
browsers;cache;cache control
Of course it is possible. Try sending these headers in your PHP code:Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0Pragma: no-cacheExpires: Tue, 1 Jan 1980 00:00:00 GMTThe Expires header can have any valid date in the past (preferably quite few years back, in case system time on that PC is set in the past as well).These headers work fine for me in all browsers (I remember testing them 3 or 4 years ago in IE 6, Firefox 2, Opera 9, Safari 4).