Luigi Bai wrote:
On Sat, 18 Sep 2004, Sylvain Wallez wrote:
Jorg Heymans wrote:
However if you really only in the serializer can detect what you're streaming back then this is no good either.
That's right, for the simple reason that the content-type header must be send to the client before the beginning of the actual response content.
True, but why does it have to be sent (or composed) before the serializer is run (assuming no cached content)? And why can't (or can it?) the serializer override the header, if it hasn't been sent yet?
Is there a way to say: for this serialization/pipeline, don't start streaming immediately, but start when I'm finished? If not, why isn't this an option? (and where can I start looking to make it one?) Then manipulation of the Response becomes possible by any Component of the pipeline.
Have a look at how a sitemap is executed [1].
Another reason also is that if the response is cached, the serializer never receives the SAX event stream. It therefore needs to know the mime-type using means external to the pipeline stream.
If the response is cached, isn't the mime-type and content-length cached with it? If not, why not?
The content-length is cached, but not the mime-type, because it is asked each time to the serializer. Now caching the mime-type may allow the serializer to set it during it's handling of the SAX stream (of course before having sent any response body).
But that's not how it is today. Want to propose that on the dev list?
Sylvain
[1] http://wiki.apache.org/cocoon/WritingForCacheEfficiency
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
