Solved

image reload

Posted on 1997-05-12
4
284 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

751 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