B4J Question [SOLVED] Update Picture with Websockets

Blueforcer

Well-Known Member
Licensed User
Longtime User
I need to update an picture in my webapp
B4X:
 <img id="images" src="url" class="center">

The server generate every 1s a new picture with the same Name, now i update the picture with
B4X:
images.SetProp("src","pic.png")
ws.Flush

this work once. i think because the browser cache the pic.png and use this instead of the new one.
Is it possible to tell the browser to use the new pic?

i tried to name the file with a random number and delete the old one. but this need a huge number to never get the same picname.

im also tried to disable the cache with
B4X:
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
but this has no effect
 
Top