accelerated http cache manager and refresh header
Hello, I have a ZPT containing a form which, once verified, spawns a thread that does some long-running processing. The initial thread then redirects to another ZPT which has the following code: <span tal:condition="python: here.getSessionData(request.SESSION.id,'state')==0"> <tal:block replace="python: request.RESPONSE.appendHeader('REFRESH',5)" /> Still processing... </span> <span tal:condition="python: here.getSessionData(request.SESSION.id,'state')==-1"> <font color=blue><b>Finished processing.</b></font><br><br> Click <a tal:attributes="href python:here.getSessionData(request.SESSION.id,'ncFile')" href="dummy">here</a> to download the NetCDF file.<br><br> Click <a tal:attributes="href python: here.getSessionData(request.SESSION.id,'mpegUrl')" href="dummy">here</a> for mpeg movie of matchup plots.<br><br> Click <a tal:attributes="href string: index_html" href="dummy">here</a> to start over.<br><br> </span> <span tal:condition="python: here.getSessionData(request.SESSION.id,'state')==-2"> <font color=red><b>Encountered an error processing your request:</b><br> <span tal:replace="python: here.getSessionData(request.SESSION.id,'errorMessage')"></span></font><br><br> Click <a tal:attributes="href string: index_html" href="dummy">here</a> to start over.<br><br> </span> Basically what is happening is that the long-running process thread is updating the status of the processing via the here.setSessionData() external method which I've written (essentially using ZODB keyed by session id). At the same time, this ZPT is refreshing until the status value is either -1 (long-running process finished successfully) or -2 (long-running process failed). This works fine, however, I have a lot of images on this ZPT and they fail to be cached by the browser. Other pages that use the same images get them fine from the browser cache or a 304 response from the server. I am using an accelerated http cache manager for the images and have taken note to represent them as absolute url's in my templates. Is there a way to get the images cached on the refreshing? Any help is greatly appreciated. Gerald
Gerald John M. Manipon wrote at 2004-5-12 15:06 -0700:
... This works fine, however, I have a lot of images on this ZPT and they fail to be cached by the browser. Other pages that use the same images get them fine from the browser cache or a 304 response from the server. I am using an accelerated http cache manager for the images and have taken note to represent them as absolute url's in my templates.
Use a TCP-Logger (e.g. Shane's "tcpwatch") to analyse the communication between browser and client. This should tell you whether Zope does not send the correct HTTP response headers. -- Dieter
participants (2)
-
Dieter Maurer -
Gerald John M. Manipon