[Zope-dev] ZPublisher events before streaming a response

2010-03-21 Thread Martin Aspeli
Hi, In some cases (e.g. large OFS.File/Image responses), Zope 2 will use response.write() to stream the response. We have events that fire before and after a regular response is returned, but none that allow us to set headers (caching headers, in this case) before such a streaming response is

Re: [Zope-dev] ZPublisher events before streaming a response

2010-03-21 Thread Hanno Schlichting
On Sun, Mar 21, 2010 at 10:07 AM, Martin Aspeli optilude+li...@gmail.com wrote: We'd therefore like to add a new event in the HTTPResponse class (in ZServer, though I think it makes sense to add to the ZPublisher base class version as well). It'd hook in something like this:     if not

Re: [Zope-dev] ZPublisher events before streaming a response

2010-03-21 Thread Martin Aspeli
Hanno Schlichting wrote: On Sun, Mar 21, 2010 at 10:07 AM, Martin Aspeli optilude+li...@gmail.com wrote: We'd therefore like to add a new event in the HTTPResponse class (in ZServer, though I think it makes sense to add to the ZPublisher base class version as well). It'd hook in something

Re: [Zope-dev] ZPublisher events before streaming a response

2010-03-21 Thread Hanno Schlichting
On Sun, Mar 21, 2010 at 12:05 PM, Martin Aspeli optilude+li...@gmail.com wrote: Hanno Schlichting wrote: Why would you need to have the event on the request, if all you want is to set headers? Why not make it an event with the response as the argument instead? Mainly because that's what all

Re: [Zope-dev] ZPublisher events before streaming a response

2010-03-21 Thread Martin Aspeli
Hanno Schlichting wrote: On Sun, Mar 21, 2010 at 12:05 PM, Martin Aspeli optilude+li...@gmail.com wrote: Hanno Schlichting wrote: Why would you need to have the event on the request, if all you want is to set headers? Why not make it an event with the response as the argument instead?

Re: [Zope-dev] ZPublisher events before streaming a response

2010-03-21 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martin Aspeli wrote: Hi, In some cases (e.g. large OFS.File/Image responses), Zope 2 will use response.write() to stream the response. We have events that fire before and after a regular response is returned, but none that allow us to set

Re: [Zope-dev] ZPublisher events before streaming a response

2010-03-21 Thread Martin Aspeli
Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martin Aspeli wrote: Hi, In some cases (e.g. large OFS.File/Image responses), Zope 2 will use response.write() to stream the response. We have events that fire before and after a regular response is returned, but none that