I'm trying to make my webpage do a hard refresh once every 30 seconds or so, but fail to get any result.
This is the code of the webpage. It shows a picture. The picture is replaced once every minute with a new one, in an external process. (The new picture has the same name) I just want to show the latest version.
<html>
<head>
<body>
<img src="avatar.png" height= 1500>
</body>
</html>
I've tried to add this between head and /head
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<script>
function autoRefresh() {
location.reload(true);
}
setInterval('autoRefresh()', 5000);
</script>
I've also tried
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<script>
function autoRefresh() {
window.location = window.location.href;
}
setInterval('autoRefresh()', 5000);
</script>
But non of them works. The webpage refreshes but with the same picture.
If I press Shift+F5 in the browser the picture changes.
Anyone have a clue how to do this?