Firefox quick image update

I have what I do where I need a web page to transfer a series of images from a local client computer. I have a very simple mileage here: http://jsbin.com/idowi/34

The code is very simple.

setTimeout ( "refreshImage()", 100 );

function refreshImage(){
  var date = new Date()
  var ticks = date.getTime()
  $('#image').attr('src','http://127.0.0.1:2723/signature?'+ticks.toString());
  setTimeout ("refreshImage()", 100 );
}

Mostly I have the recharge used on the client machine. We want the signature to appear on the web page, and to let them see how they sign it on the web page (there is no LCD on the pad to show them there). Therefore, I am setting up a simple local HTTP server that captures an image of what the current state of the signature looks like and it is sent to the browser.

This has no problems in any browser (tested in IE7, 8 and Chrome), but Firefox, where it is extremely backward and nervous, does not support 10 FPS. Anyone have any ideas on how to fix this? I tried to create very simple double buffering in javascript, but that only made matters worse.

Also, for more information, it seems that Firefox is executing javascript with the correct frame rate, since requests are received at a server at a constant speed. But images only update inconsistently from 5 times per second up to 0 times per second (it takes 2 seconds to update).

I also tried using different image formats with the same results. Formats I tried include bitmaps, PNGs and GIFs (GIFs caused a minor flicker issue in Chrome, though)

, Firefox - , ? :

Pragma-directive: no-cache
Cache-directive: no-cache
Cache-control: no-cache
Pragma: no-cache
Expires: 0
+3
3

, , Firefox. firefox . , ( javascript) . 50 , .

, "" , Firefox .

+1

, Firefox DNS- IPv6.

IPv6 , .

+1

, ; , " ", . , <img>, "src" , (10, ). ": ". "load" <img> , <img>, . ( , , -, ) , .

? . , , .

0

Source: https://habr.com/ru/post/1747086/


All Articles