I have a shape in Visual Overview that should show a thumbnail of a JPG that updates every 5 seconds. The URL stays the same, but the image changes. I'm using 'Link' shape data with the following value:
#http://<DMA IP>/VideoThumbnails/Video.htm?type=Generic Images&source=https://UrlToMyImage.com/myImage.jpg&proxy=false&refresh=5000
I see the image, but it's not refreshing. My source URL is not hard-coded like above, but comes from a parameter value. If I change the URL to something like myImage.jpg?1, it updates once. I think this is cached by the browser.
How can I properly refresh my image without having to update my parameter every 5 seconds, please?
There are a few options:
- When the browser downloads the image, it might also receive http-headers that indicate if (and for how long) the browser is allowed to cache the file. If you have control over the http server that provides the image ("https://UrlToMyImage.com"), then it's possible to configure these http-headers.
- If the DMA agent is able to download the image (has Internet or network access), then it's possible to put "proxy=true" in the url of the VideoThumbnails. When using the proxy, the browser will do an API call to the DMA to get the image, which the browser won't cache.
- If the above options aren't possible, then you'll have to update the source parameter in the url manually, so that the url is different on each refresh interval.
There might be better solutions, but if you want a quick one:
In the Visio shape, replace the ?1 in your URL with ?[DataMinerTime]
That placeholder will updated every second. As the URL is each time unique, caching should no longer be an issue.
Note: In case 1-second updates are too fast, it's probably possible to manipulate the DateTime string trough RegexReplace in order to force a different update rate.
This is indeed a workaround for the problem but do note that this comes at a performance cost (updating the url will cause a full navigation to be done).
The workaround with [DataMinerTime] seems to work, but like Sebastiaan mentioned it’s not really nice for the eye. It refreshes the entire page and shows a white page for a fraction of a second…
I’ll go for the proxy=true option. Thanks a lot!