Cache problems |
Cache problems |
TomKimball |
Feb 11 2012, 12:28 PM
Post
#1
|
Group: Members Posts: 1 Joined: 11-February 12 Member No.: 16,452 |
Hi: I built a simple website with HTML on Yahoo Web Hosting. I have several cameras that FTP images to the server and these images are displayed on various web pages. They have been working fine for many years, save that one must refresh the page to see the latest image. Lately, the image cannot be refreshed on the page unless I use a control+f5 refresh. A simple refresh will no longer work. When I contacted customer support they were unhelpfull. Basically telling me to just clear my cache. This does not work. And I know of no way to do a hard refresh on an ipad, so using that is useless to view the site.
I have tried several meta tags to get the page not to cache, but they do not work for me. And I'm not sure if that's the problem, since clearing the cache doesn't work anyway. What's weird to me is that if anyone on my network or any network, does a control+f5 refresh, I am able to see that picture with a simple refresh on my computer. Hope this makes some sense. Are there meta tags or html code that can force a page to do a control +refresh??? Any ideas would be appreciated, thanks. Here is a page on a site with a camera image. The image is updated every 15 seconds, so you can tell if the picture is new if the flag moves. http://fiskcam.com/fisklake.html Thanks in advance for any help. |
Christian J |
Feb 11 2012, 05:59 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,630 Joined: 10-August 06 Member No.: 7 |
I can't refresh the image in the web page (using F5 only), but refreshing http://fiskcam.com/sitebuilder/images/webcam32-568x430.jpg directly works. I don't know why my browser (Opera) treats the image different like that. Another strange thing is that after I've reloaded the image file in Opera, I can suddenly reload the image (embedded in the web page) in Firefox too (but not before).
FWIW 1, the HTTP header of the image file (examined with http://www.rexswain.com/httpview.html ) contains this: CODE Cache-Control:·max-age=864000(CR)(LF) Expires:·Tue,·21·Feb·2012·22:01:18·GMT(CR)(LF) FWIW 2, a trick to prevent caching is to change the querystring in the IMG element each time the page is requested. Here's a javascript that might work: CODE <img src="" alt="Fisk Lake Webcam" id="pic"> <script type="text/javascript"> document.getElementById('pic').src='http://fiskcam.com/sitebuilder/images/webcam32-568x430.jpg?t='+new Date().getTime(); </script> (In browsers without JS there will be no image. You might add a backup image inside a NOSCRIPT element.) Some general reading about caching, but most of the advice seems to assume some control over the server: http://htmlhelp.com/faq/html/publish.html#no-cache |
Lo-Fi Version | Time is now: 29th March 2024 - 05:34 PM |