[mod_python] Questions for the FAQ - please check and confirm (req.write() and return) also docs update ...

vio vmilitaru at sympatico.ca
Fri Aug 16 14:47:17 EST 2002


Same here. My handler builds dynamic pages using successive calls to
req.write() with no problems. In fact, the only issue here might rather be 
whether it is better (as in 'less expensive') to 'assemble' the document in 
memory and send it in one swoop to the client, as opposed to sending it 
in many calls to req.write().
In other words, whether it's preferable to assemble a dynamic document at
the server level, or at the client level. I would tend to believe 
the former is better, because it reduces network traffic. Though I could be
mistaking. But mod_python definitely allows both strategies.

Vio

* Gregory (Grisha) Trubetskoy <grisha at modpython.org> [020816 14:23]:
> 
> 
> On 16 Aug 2002, Fabian Fagerholm wrote:
> 
> > If you're using the Publisher handler, you can use req.write() once,
> > but then you *have* to return something at the end of your function,
> > or things won't work.
> 
> You should be able to use write() many times as you like. It should also
> be ok to return an empty string *if* you have written something with
> write(), otherwise returning an empty document will cause a problem with
> Netscape at least.
> 
> Grisha
> 
> 
> 
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://www.modpython.org/mailman/listinfo/mod_python



More information about the Mod_python mailing list