I want automatic updating, not just automatic updating on my web pages

I know that I can automatically update on some of my web pages (for example, on the home page of my site) by inserting a meta tag , for example

<meta http-equiv="refresh" content="600">

But after that I get a long page length and session duration . This is unrealistic, and I think the update does not "reset" the page duration counter, which I think should happen.

I assume this can be done with a hard update (Ctrl-F5 on Windows, Option + R on MacOSX), but I don't know if it is possible to force update update / strong> ... or if such an update will serve my purpose.

+5
source share
2 answers

I was looking for the answer to this question, and all of this, apparently, in the headers.

You need to send the header without a cache, in php it will be:

header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past

.. and then just update as usual (javascript or meta).

+1
source

Use this method:

http://grizzlyweb.com/webmaster/javascripts/refresh.asp

It uses JS to update and does not load the page from the browsers bf cache, so it should do what you need. It will also prevent users from getting into the BF cache so that they can use the back button correctly.

0
source

All Articles