I'm trying to use a GET request to retrieve an image from a server. The image is constantly changing, so I want to grab the image a few times every second (with the intent of displaying the images and imitating video eventually). However, there's something going wrong with the GET request. No matter how rapidly I try to GET the image (tried every 1s, 100ms, etc), it only returns a new image every 5 seconds. It's acting like there's a cached image somewhere and it's only updating the cache every 5 seconds, returning old, duplicate images all other times.
I've done the following to try to isolate the problem:
And yet it is still only actually retrieving new images every 5 seconds.
Example Request Headers:
Cache-Control: no-cache
Connection: keep-alive <-- Could this be the problem?
Pragma: no-cache
Example Response Headers:
Cache-Control: no-cache
Cache-Control: no-store
Connection: close
Pragma: no-cache
Server: Apache-Coyote/1.1
My query (executed after a time delay every time image is loaded):
document.getElementById("videoDisplay").src = filename + "?random="+(new Date()).getTime();
Found this at http://tomcat.apache.org/tomcat-5.5-doc/config/context.html Read this entry there..
Amount of time in milliseconds between cache entries revalidation. If not specified, the default value is 5000 (5 seconds).
May be this is the source of your problem
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With