Josh Goldstein on 1 Jan 2009 16:31:49 -0800 |
I would try generating the new image under a different name, and then renaming the new image to the same name as the old one. I would assume that the renaming would be atomic as far as the web page server (apache?) is concerned, so the viewer either gets sent to the old image or the new image. If you try to use some synchronization so that the web browser happens to reload only between the python script regenerating the page/images I think it will be unnecessarily convoluted. What exactly are you regenerating every 15 seconds? Are you making the 2 new images and regenerating the web page to have its image's src properties match the name file names?? -Josh I've got an application which regenerates and reloads a web page every 15 seconds. (The page is regenerated with a python cgi-bin script, and this process is triggered by the HTML directive "<META HTTP-EQUIV='REFRESH' CONTENT='15'>"). This system is simple and works very well. I've got mostly text data, but there are 1 or 2 large graphics images in each page. Unfortunately, the process of loading a new page clears out the old page, and is unsightly while the new one is being regenerated and downloaded. I would like to be able to regenerate and download the new page while the old one is still being displayed, then instantly switch to the new page so as to minimize this 'redraw" phase. I'm not skilled enough to try to use some type of _javascript_, and the application isn't critical enough to motivate me to acquire the missing skills. Does anybody know of a simple way I can freeze the existing page in a web browser until the replacement page is fully formed and rendered? ___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug
|
|