简体   繁体   中英

how to force browser to re-request page after history.back()

I've got two scripts: 1.php and 2.php. Here they are:

1.php

<?php

header('Pragma: no-cache');
header('Cache-Control: max-age=1; no-cache');
header('Expires: Tue, 1 May 1985 01:10:00 GMT');
header('ETag: "'.md5(rand(1, 1000)).'"');

print date('H:i:s');
?>
<a href="2.php">pay</a>

2.php

<a href="javascript:history.back()">back</a>

Visitor lands on 1.php and then goes to 2.php. I want browser to re-request 1.php after vistor's click on "back" link. Currently, it doesn't work. How it can be managed?

upd. I can edit 1.php ONLY and cant edit 2.php.

In practice you can't. Although browsers should send a new request for a non-cacheable page (ther are several things broken in the headers you are sending) both MSIE and Firefox will always use an in-memory copy within a certain timescale.

C.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM