I have a web page that is currently using a timer mechanism to update the source of an image element <IMG> to allow the browser to repaint to retreive a dynamically created image and render it at a 10 to 20 fps rate. This currently involves an HTTP request and response from the browser, with all the HTTP overhead. What I would like to do is push the update image content from the server rather than have it pulled using something like web sockets, using binary data to the browser cache, and then after the content is cached, then the img.src value is changed, the browser would somehow know that the updated image has been already cached and not attempt to retrieve it from the server. The application will require JavaScript to be active and enabled in the browser.

Anyone, perhaps with QtWebKit knowledge, know of a means of filling the browser cache using say JavaScript and web sockets, and having the cached content somehow identified by the browser so that when the image source value is specified to some handle, it will not perform an HTTP request and response for the update image content.

The question really has less to do with the transport of the updated image using web sockets, and more to do with how browser caching works, and how one might populate content using JavaScript, and how the cached content is somehow mapped to a reference URL to prevent the browser from having to retrieve cached content.