Question

i am working on a problem where the background image set in mxGraph is downloading the image when the user moves any object on the screen.

I can see in the firebug and chrome the mxClient.js is downloading the image causing this flicker . The following is the code from that script.

           this.shiftPreview1.parentNode.removeChild(this.shiftPreview1);
           this.shiftPreview1 = null;
           this.container.appendChild(c.parentNode);

i can see that when the appendChild is called the browser downloads the image. So is there anyway in java script/mxgraph where i can avoid this .

Can appendChild on a container take the image from the cache instead of downloading again ?

Was it helpful?

Solution

i found the answer to my own question , there is a difference between the way the browsers behave . As soon as the js removes the image from the DOM the chrome removes the image from cache but FF does not .

I solved it by setting the cache control on the server side so that i force the chrome to cache the image for some time .

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top