Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q892 How can I force the browser to load an newer version of the same named image from the server?

You are here: irt.org | FAQ | JavaScript | Image | Q892 [ previous next ]

The image is stored in the browsers cache - you need to either stop it being cached by adding the following to the document:

<html>

<head>
<meta http-equiv="Expires" content="Fri, Jun 12 1981 08:20:00 GMT">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
</head>

<body>
...
</body>

</html>

Or refresh the image using a simple JavaScript trick:

<a href="page.htm" value="Reload"><img src="picture.gif" onLoad="this.src='picture.gif?' + (new Date()).getTime()"></a>

Feedback on 'Q892 How can I force the browser to load an newer version of the same named image from the server?'

©2018 Martin Webb