[Twisted-web] Set request headers in rend.Page

Mary Gardiner mary-twisted at puzzling.org
Mon May 31 18:50:40 MDT 2004


I have a subclass of rend.Page. When this page is rendered to HTTP, I
want to modify the request object (specifically, I want to set an entity
tag, since this resource is quite large when transferred and is being
polled every ten minutes).

I don't know whether the underlying data has been modified until after
locateChild has finished, so I can't modify the headers there, unless I
move a lot of functionality into the parent page in the tree. This seems
strange from a design point of view. (Why should the parent Page need to
know enough about the child to be able to tell if its underlying data
source has changed?)

Is there some point where I can add new headers to the request in a Page
itself? I haven't tested thoroughly, but it seems to me that the HTTP
headers have already been transmitted by the time render_ and data_
methods are called.


More information about the Twisted-web mailing list