I have a simple javascript that pans through webcam images. I does not update the images until one goes in and clears the cache, at that point the most recent images show up. Is there some code in javascript I can use to have this done or is there another method to achieve this?


Nevermind, thought it was fixed but the meta tags I was trying have not been successful beyond the first image. Any JS solutions to this?

The only valid solution to this problem of yours is to set proper response headers related to caching. For e.g. to make images uncacheable, serve them with a response header Expires: some past date . Google for caching headers.

Simply set an onbeforeunload event. One, you can give the user a chance to re-think the decision to leave the page by spawning a "yes/no" dialog box; and two, just having an onbeforeunload event will cause the browser to never cache the page: This means that the page will always be rendered exactly as if the user was hitting it for the very first time.
This should go inside the <head><!-- || --></head> tags'.

<script type="text/javascript">
window.onbeforeunload = function () {
 // This fucntion does nothing. It won't spawn a confirmation dialog
 // But it will ensure that the page is not cached by the browser.

Thanks for the ideas. I am trying them out now. Its funny, everything is working fine in FF but IE7 not so much.

This article has been dead for over six months. Start a new discussion instead.