image reload

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.
fickenAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ex-ibmCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
fickenAuthor Commented:
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
ex-ibmCommented:
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
ex-ibmCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.