Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Don't cache changed image.src?

Reply
Thread Tools

Don't cache changed image.src?

 
 
jetmarc
Guest
Posts: n/a
 
      06-28-2003
Hi.

I have a webcam page (video surveillance) that refreshes 9 images
once a second (1000ms rate). It uses javascript to change the
image.src

To trick the caching mechanism of the browser and force a fresh
download from the IP camera, a random tag is appended to the URL.

Unfortunately MSIE6 (WinXP) caches each and every frame ON DISK.
That is, while the page is displayed, the harddrive stores 9*20kb
or ~200kb per second. And worse, MSIE lets the temp folder grow
very big, resulting in reduced system performance (especially
when booting up after a work-day of video surveillance).


What can I do about it? The life-time of an image is 1 second,
it will never be used again. I don't want the browser to store
it on the harddrive.

I tried this on my page:

<HEAD> <META http-equiv="Pragma" content="no-cache"> </HEAD>

but it seems to work only for the HTML portion of the page, not
for the image.src loading.


I tried to locate a RAM drive where I can point the MSIE6 temp
folder to, so that at least it won't cache on the harddrive,
but couldn't find any solution (for WinXP) either. And also, I
went for HTML/JavaScript to NOT have to install anything on the
client machine


Can you point me to a solution for this problem?

Marc
 
Reply With Quote
 
 
 
 
Jim Ley
Guest
Posts: n/a
 
      06-28-2003
On 28 Jun 2003 10:21:06 -0700, (jetmarc) wrote:

i.
>I tried this on my page:
>
><HEAD> <META http-equiv="Pragma" content="no-cache"> </HEAD>
>
>but it seems to work only for the HTML portion of the page, not
>for the image.src loading.


Of course, why would it work anywhere else?

>Can you point me to a solution for this problem?


If you'd read the FAQ, you'd've seen the link to
http://www.mnot.net/cache_docs/

It will not, and cannot be solved with javascript.

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

 
Reply With Quote
 
 
 
 
Jim Ley
Guest
Posts: n/a
 
      06-28-2003
On 28 Jun 2003 15:46:51 -0700, (jetmarc) wrote:

>> If you'd read the FAQ, you'd've seen the link to
>> http://www.mnot.net/cache_docs/
>>
>> It will not, and cannot be solved with javascript.

>
>Thanks for your follow-up.
>
>Actually I have seen that page before, when researching. The problem
>is that I don't have any influence on the HTTP headers, because the
>image URL is on a physically separate web cam (Axis 2100 IP network
>camera).


Then get some influence, simply proxy it through a real server, and
next time choose a tool that allows you to do your job.

>I think, actually the MSIE browser does honor the no-cache pragma in
>that it reloads the HTML page _AND_ the initial dummy images from
>scratch each time I open the page.


It's unlikely that a web cam server is sending cacheable headers,
therefore IE won't cache the image between page reloads on its default
setting - it wll within instance.

> I conclude that maybe Axis as a manufacturer of
>web cams themselves did not find a way to circumvent MSIE's behaviour
>of producing a local FILE


IE does not _always_ save a local file.

>Basically, I'm looking for a client-side solution.


There is no client-side solution...

>I can't change
>the cameras behaviour unless I re-engineer their embedded firmware,
>or cache all cam images on a linux server


No, it's simple, put Apache as a proxy between the web and the camera,
you can then control the headers and everything else in Apache.

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display Updated/changed value(from cache) in JSP Buddha Java 6 02-01-2008 08:52 AM
changed state to up changed state to down FastEthernet LINEPROTO-5-UPDOWN surrealarmada@gmail.com Cisco 3 03-07-2007 06:06 PM
scroll position is changed when style is changed? mxbrunet Javascript 1 11-03-2006 03:40 AM
xmlDocument.Save "&#10;" getting changed changed to "&amp;#10" st@jpa.co.jp ASP .Net 1 10-11-2005 01:30 PM
Cache dependency for SQL database changed Steffen Loringer ASP .Net 2 05-17-2005 03:38 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57