javascript - IE dynamic image caching issue? -


itemprop = "text">

I have an html page that is loading more than one iframes in which the dynamic server created from the Tomcat server page (.jsp) There are images. Expected by Chrome and Firefox, this works, but for some reasons IE looks like all images (as the first image). I made an example:

jsImageTest.html - this page loads 6 instances of testImageFrame.html page separately Iframes in one-to-one-time, using javascript.
testImageFrame.html - The page has been loaded in all iframes. It only has Javascript blocks that write the current time and an IMG tag. The IMG is dynamically generated by a .jsp page on a separate server, it should have a white box on a black background. The box is randomly built between the current time (from the Tomcat server using Java) and 0 and amp; 1.

What happens (in IE): The page loads nearly four similar iframes almost immediately. Depending on the speed of your machine, the javascript bar may be different from one or two at the time of the images, all will be the same as the random number. It is also true for the last two iframes that are loaded after 5 and 10 seconds (by javascript settimeout ())
what should be (as it happens in chrome and ff): < / B> The page loads the same 4 iframes, but the random numbers in the images will vary. Sometimes in the time of images, each other increases as well.

Does anyone have a clue what's going on here? IE is doing some weird caching? The image header contains "no-cache", "no-store" and all this. I have tried it on IE 6 and 7. You can use the "Next" button to create another iframe. In IE, images are always the same.
Note: In fact iframes, just do not need images, but if I only use IMG tags, then the problem also appears in Chrome and FF I do not really need to load these IFrame dynamically, I was just trying to summarize this issue and allowed delayed load for subsequent 2 images.

MSIE is great when it comes to caching. The problem here is that it does not follow the caching instructions, as the "basic" HTML page is specified in the headers, from which the JS code is executed.

Your particular problem can be solved by adding a timestamp in the query string.

  ifr.src = 'testImageFrame.html?' + New date (). GetTime ();  

This force MSIE has to fire a new GET request from JS.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -