-2

Is it possible to check if the client has a cached version of a website, and if so, force his browser to apply a hard refresh once?

bas
  • 52
  • 3
  • Ok people, I should have re-phrased this one. So, I uploaded a temp page using But after changing index.html to a real site, and removing the refresh meta line, it still redirects. Can I make sure that people, including me, dont get redirected but just see the website? – bas Jun 06 '17 at 19:18

2 Answers2

0

You can't force a browser to do anything, because you don't know how rigidly a remote client is observing the rules of HTTP.

However you can set HTTP headers which the browser is supposed to obey.

One such is Cache-control. There are a number of values that may meet your needs including no-cache and max-age. There is also the Expires header which specifies a wall-clock expiration time.

slim
  • 40,215
  • 13
  • 94
  • 127
0

It is not ready apparent if the client has a cached version. To tell the client not to use cache you can use these meta tags.

<HEAD>
<TITLE>---</TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</HEAD>
Wayne
  • 4,760
  • 1
  • 24
  • 24