Solved

image reload

Posted on 1997-05-12
4
281 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…

920 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now