cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierpaolo Fumagalli <>
Subject Re: Content-length
Date Mon, 24 Jan 2000 01:07:19 GMT
Ross Burton wrote:
> >  I like Cocoon. I think it might be the way all things should happen in the
> > web. But to do that Cocoon must be as `web friendly' as posible, as static
> > pages are. e.g. it must send the proper HTTP headers in order to cooperate
> > with caches and other HTTP software. From reading the sources it seems very
> > easy to add the Content-length header. The whole content is first stored in
> > a String (in Engine.handle()). It would be a matter of sending the
> > string.length();. This could be done now... is there any reason this is not
> > being done?
> This works now, but what about the mythical Cocoon 2, where the sending of
> content may happen before all of the data has been processed, because of the
> SAX event model?

It's not a problem with the DOM/SAX model, IMVHO. In both cases the
format in wich the data is supplied to the serializer does not contain
information on the content length.
It's a problem related to the caching system. If the serialized data is
stored into a String and THEN sent to the client, we can put the
Content-Length informations, while, if it's streamed as data is coming
(regardeless if we're traversing a DOM tree or receiving SAX events), we
can't provide informations on the length of the stream.
This, of course, applies only when the document is generated, and not
when is served from the cache, because, if it resides in the cache (and
so is already a stream, either a file on the disk or a string in
memory), we can find out the length.
All the problem, IMVHO, relies on the caching mechanism.


-          P              I              E              R          -
stable structure erected over water to allow the docking of seacraft
<>    <>
- ApacheCON Y2K: Come to the official Apache developers conference -
-------------------- <> --------------------

View raw message