Does GWT buffer or stream the servlet response?

91 views
Skip to first unread message

Peter Jay

unread,
Jan 6, 2013, 4:38:47 AM1/6/13
to google-we...@googlegroups.com
Hi,
I want to know if Jetty that comes with GWT buffers or streams the data that is written to the servlet response?
(i.e. when you call servletResponse.getOutputStream() or servletResponse.getWriter() ).
That is important as when this is streamed this should on the one hand be faster and on the other hand the response will be committed after the first byte was written.

Can this be configured?

Thanks,
Peter.

Jens

unread,
Jan 6, 2013, 10:53:57 AM1/6/13
to google-we...@googlegroups.com
There are always bufferes here and there to increase performance. Take a look at the jetty documentation and the configuration of jetty's connectors (send buffer). You also have ServletResponse.setBufferSize(). Take a look at Jetty's source code to see how it uses this buffer size.

It also somewhat depends on the client. If you do a HTTP 1.0 request and your servlet does not set a Content-Length header then the servlet container probably has to buffer the whole response in order to compute the Content-Length as this header is mandatory for HTTP 1.0. In case of HTTP 1.1 you don't have to set a Content-Length header but use chunked transfer encoding instead.

-- J.
Reply all
Reply to author
Forward
0 new messages