Is there a way to update a picture live and dynamically? Let me explain:
There is an application that uploads a picture in a various amount of time. At the moment, my script just ask every 5seconds for a new picture on the server but thats kinda old school and not a very good solution. So my question: Is it possible to detect a new picture on the server and show it immediately on the page?
The problem with regulary requests (every 5seconds) is that if the picture is loaded after a request it takes like 10seconds to update and thats a bit too long. And to make a request every second is quite a bad idea.
You will need server side push technology (also known as Comet) to do this. The exact implementation is really dependent on the server-side programming language you are using.
Edit:
A quick search on stackoverflow on ‘Comet’ gives a lot of additional info (also specific to certain programming languages): https://stackoverflow.com/search?q=comet