[Zope] accelerated http cache manager and refresh header

Gerald John M. Manipon Geraldjohn.M.Manipon at jpl.nasa.gov
Wed May 12 18:06:57 EDT 2004


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: 
          <tal:block replace="python: 
request.RESPONSE.appendHeader('REFRESH',5)" />
          Still processing...

<span tal:condition="python: 
          <font color=blue><b>Finished processing.</b></font><br><br>
          Click <a tal:attributes="href 
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 tal:condition="python: 
          <font color=red><b>Encountered an error processing your 
          <span tal:replace="python: 
          Click <a tal:attributes="href string: index_html" 
href="dummy">here</a> to start over.<br><br>

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.


More information about the Zope mailing list