views:

51

answers:

3

Hello, I have a PHP page (a.php) which is already sending these headers:

<?php
header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); 
header('Pragma: no-cache');
?>

And on the PHP page (a.php) , it has a link to another page (b.html)

on b.html, it has a javascript code to:

<script type="text/javascript">        
history.go(-1);
</scirpt>

It seems to me that, when the browser is "going back" to a.php,the content isn't fresh at all.

Would you please advise me if generating a completely fresh page on history.go(-1) is possible?

Thank you.

+3  A: 

Well going back is a browser thing. It simply goes back to the previous page in the cache. The page content is not entirely reloaded.

I recommend redirecting to a new page (even if it is a.php) instead of going back to it.

St. John Johnson
+1  A: 

you could try server variable HTTP_REFERER

header('Location: '.$_SERVER["HTTP_REFERER"]);
markcial
A: 

you can use meta tags to not cache the page, page will beloaded again then.

Grumpy