N
N
niko832012-04-09 19:58:39
Opera
niko83, 2012-04-09 19:58:39

How to force Opera to refresh the page after pressing the Back button

I press the Back button in the Opera browser, instead of returning me to the previous URL and refreshing the page, the opera gets the page from its cache.

Searched the Internet, found things that do not work for example: and do not work. How to beat it?

header('Pragma: no-cache');
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

meta http-equiv="Cache-Control" content="no-cache, no-store, must- revalidate"
meta http-equiv="Pragma" content="no-cache"
meta http-equiv="Expires" content="-1"



Answer the question

In order to leave comments, you need to log in

6 answer(s)
S
sl_bug, 2012-04-09
@sl_bug

If you find a way, please don't tell anyone. I don't want to see this kind of behavior everywhere :)

E
egorinsk, 2012-04-09
@egorinsk

And I have a question. Look, 2 situations:
1) the user opened your page, switched to another tab, went to drink tea, googled, returned, switched to a tab with data that was outdated many hours ago
2) the user left your page using the link, clicked "Back" and I saw a little outdated data
If you want to solve problem 2, why don't you solve more actual problem 1?
You can decide like this. when loading the page, make an Ajax request to the server and, if newer information is available, update it with Ajax.

S
Skpd, 2012-04-09
@Skpd

Browsers should not cache POST requests, which means the back button will not work either.
Try to perform POST requests in the right places, instead of GET.

U
usja, 2012-04-09
@usja

You can put Yandex.metric and select all the checkboxes for the counter (more precisely, track the hash code).
At me then at return "back" the opera refreshes the page. But, I won’t say for sure about POST whether it will send a request or not

A
Anatoly, 2012-04-10
@taliban

In such a situation, I checked the relevance of the data with JavaScript, and did a redirect if they were out of date.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question