RESPONSE.write - Still not working
Thanks to those who responded with some ideas regarding my RESPONSE.write problem - but it's still not working! Based on the responses I now have a dtml method containing (note: I have tried it with and without the Transfer-Encoding header): <dtml-call "RESPONSE.setHeader('Transfer-Encoding', 'chunked')"> <dtml-call "RESPONSE.setHeader('Content-Type', 'text/plain')"> <dtml-call "RESPONSE.write('Starting\n')"> <dtml-call "RESPONSE.flush()"> <dtml-call "wait(5)"> <dtml-call "RESPONSE.write('Done\n')"> <dtml-call "RESPONSE.flush()"> The 'wait' routine is still a simple external method: import time def wait(self, secs): time.sleep(secs) return What I expected to see was the word 'Started' displayed in my browser, followed by a 5 second delay, and then see the word 'Done' displayed. What I get is a 5 second delay and then both 'Started' and 'Done" appear at the same time. FYI: I am running zope 2.6.1, python 2.1.3, RedHat linux 2.4.20, Apache 1.3.26 Any other ideas would be great! Thanks again, Jonathan
Did you try without Apache in the mix? Proxying may well do its own buffering... Stefan --On Mittwoch, 17. September 2003 09:31 -0400 Jonathan Hobbs <toolkit@magma.ca> wrote:
What I expected to see was the word 'Started' displayed in my browser, followed by a 5 second delay, and then see the word 'Done' displayed.
What I get is a 5 second delay and then both 'Started' and 'Done" appear at the same time.
FYI: I am running zope 2.6.1, python 2.1.3, RedHat linux 2.4.20, Apache 1.3.26
-- The time has come to start talking about whether the emperor is as well dressed as we are supposed to think he is. /Pete McBreen/
Hi Jonathan, Jonathan Hobbs wrote:
Thanks to those who responded with some ideas regarding my RESPONSE.write problem - but it's still not working!
Based on the responses I now have a dtml method containing (note: I have tried it with and without the Transfer-Encoding header):
<dtml-call "RESPONSE.setHeader('Transfer-Encoding', 'chunked')"> <dtml-call "RESPONSE.setHeader('Content-Type', 'text/plain')"> <dtml-call "RESPONSE.write('Starting\n')"> <dtml-call "RESPONSE.flush()">
<dtml-call "wait(5)">
<dtml-call "RESPONSE.write('Done\n')"> <dtml-call "RESPONSE.flush()">
The 'wait' routine is still a simple external method:
import time def wait(self, secs): time.sleep(secs) return
What I expected to see was the word 'Started' displayed in my browser, followed by a 5 second delay, and then see the word 'Done' displayed.
What I get is a 5 second delay and then both 'Started' and 'Done" appear at the same time.
1.) I dont think using DTML is a good idea for this, and not because I hate DTML but because almost every tag in DTML actually produces output - and this stands diametrical against your desire to control output via response.write() response.write() just switches output mode from one single response at the end of publishing to small chunks during publishing process. 2.) With recent Zope (2.6+) you dont send Transfer encoding and stuff because ZPublisher does this on its own when you use response.write() response.flush() just does nothing. - if there is any caching and buffering active it will remain. If it does not work out just make sure you are using a current Zope version, since things are probably broken in older. Regards Tino Wildenhain
participants (3)
-
Jonathan Hobbs -
Stefan H. Holek -
Tino Wildenhain