Solved

image reload

Posted on 1997-05-12
4
283 Views
Last Modified: 2013-12-25
I have a web cam that is set to save a new image over the same filename every ten seconds. They way I have the web page set now with just an img tag to reference the image does not work well, as when one hits reload or refreshes the page the same old image is always called up due to the browser caching the image. Is there a way to make the latest version of the image load whenever the page is refreshed? I have tried using the <meta http-equiv=pragma content=no-cache> but this tag does not seem to work. Is there another way to make this work with all or most browsers? I would even be interested in any scripts that might provide the effect of pulling up the latest version of the image.
0
Comment
Question by:ficken
  • 3
4 Comments
 

Accepted Solution

by:
ex-ibm earned 90 total points
ID: 1854197
Hi ficken!

I really enjoyed researching your question, because getting HTML pages refreshed is always an interesting and challenging exercise.  In this case, I think you're close to exactly where you want to be with the code you have.

However, I've been using another META choice for quite a while now, and I think it is real neat and it will do the job you're looking for.  Let's do this in two steps:

Step 1:  Make sure that the META element you place in your HTML document is in the HEAD element...META will only work there.

Step 2:  Place this code (once again, in the HEAD element):

           <META HTTP-EQUIV="REFRESH" CONTENT=10>

Try it, you'll like it!  Then, be sure to save the code.  You'll undoubtedly find it useful many times in the future.

Best regards...
0
 

Author Comment

by:ficken
ID: 1854198
I have tried this meta tag as well, but refreshing the page does not make the browser reload the image, since the old image and new image have the same name and file size, the browser assumes they are the same and just loads the old image from cache...any other suggestions?
0
 

Expert Comment

by:ex-ibm
ID: 1854199
Yup.  Try this construction:

     <META HTTP-EQUIV="REFRESH"CONTENT="10;URL=http://www.xxx.yyy/etc.">

This construction is supposed to fetch directly from the URL.  Will your (or somebody else's) browser intercept that and go to cache anyway?  Can't tell you.  Try it and see how it works on your browser.

Like I said earlier, "... always an interesting and challenging exercise."!!!

Best regards...

 
0
 

Expert Comment

by:ex-ibm
ID: 1854200
Hi Again!

I just noticed something.  Your question didn't happen to mention which browser you're using.  That's important.  The function we're talking about here (called 'Client Pull') is only..repeat..only supported with Netscape (after 2.0, I believe) and Internet Explorer browsers.  If you're using one of these, what we're suggesting (and what you did in the first place, for that matter) should be working.

If your browser is 'something else', try your code somewhere that you can view it on one of those two browsers.  It should work just fine.  

If you're 'stuck' with a brand 'X' browser, then I'm afraid you're limited to manual refresh.  That's not really too bad you know.  Just tell your user something like:  This image (object, whatever) needs to be periodically refreshed.  To refresh, just click here.  Make the words 'click here' a 'hotspot' to your URL.

Sorry I didn't notice this in the first place.  Perhaps, if I had, we'd have saved some time.  Hope this clarifies things for you, and good luck in your Authoring pursuits!

We really do appreciate your using Expert's Exchange.  Your confidence in our ability to address your questions is highly valued, and we hope you'll feel inclined to use our services again whenever we can be of assistance.

Best regards...

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Read about why website design really matters in today's demanding market.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to dynamically set the form action using jQuery.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question