09-21-2023 01:15 PM
Hello,
I have a program that puts an image on a website.
Every minute a new photo is taken, which updates that image on the website.
I use a URL image to display this image in gWeb.
This works so far, but:
How can I update the shown Picture in the "URL image" Container in gWeb?
Here I only see the photo from the start.
09-21-2023 03:09 PM - edited 09-21-2023 03:10 PM
Hi Patrick_321,
What is likely happening is that the browser is caching the image at that URL. If you write the same URL to the image repeatedly, if the image is already in the cache then it won't be updated.
It depends on your server if it is safe to do but a common way to modify the URL and trigger a new download is to add a random number as a search parameter.
For example, for the url http://example.com:8080/Picture.png you may add a search parameter like http://example.com:8080/Picture.png?_=1234 for example. In that example the search parameter name that was added is _ and the value is a number generated randomly, in this case 1234. As long as adding a search parameter with a random number to the URL does not cause issues with the server that can be a common approach.
Another behavior you are likely to run into is that when changing the URL the image will be cleared immediately until the new image loads. This can cause an undesirable flicker depending on how fast the image is updated. The Synchronous Image for WebVI example gives you a new image control where you can control the updates more precisely. You can use that library to only update the image after a new one has loaded.
09-24-2023 09:16 AM
works thanks also the Synchronous Image for WebVI 😘
But only on my iphone, not on chrome or android handys
What the problem could be, no idea.
09-24-2023 01:10 PM
@Patrick_321 wrote:
works thanks also the Synchronous Image for WebVI 😘
But only on my iphone, not on chrome or android handys
What the problem could be, no idea.
Oh interesting, not sure. On an up to date Android Pixel 4a running Chrome 117 the Synchronous Image Demo Page seems to run correctly.