tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kitching Simon <Simon.Kitch...@orange.ch>
Subject RE: document cacheing
Date Tue, 26 Sep 2000 16:50:29 GMT
Hi,

Yes, tomcat does indeed buffer, exactly 
as you suspected and Dave described.
To work around this, just add an 
out.flush() after your out.write(),
or use the more complicated 
buffering-control methods of the 
HttpResponse(?) class.

Regards,

Simon

> -----Original Message-----
> From:	Bolt, Dave [SMTP:boltd@atsc.army.mil]
> Sent:	Tuesday, September 26, 2000 6:27 PM
> To:	tomcat-user@jakarta.apache.org
> Cc:	andrew.kidder@tivoli.com
> Subject:	RE: document cacheing
> 
> Andrew,
> 
> If your servlet engine supports the 2.2 Servlet spec then section 6.1 of
> the
> spec indicates
> that the container may (optionally) buffer the output sent to the client.
> 
> My guess is that buffering was added to make some of the magic of JSP
> possible. This is
> probably what you are seeing.
> 
> Dave Bolt
> ATSC/SPAWAR ASAT Team
> Bolt's Law of Bandwidth - There is always plenty of network bandwidth,
> just
> none for you.
> 
> 
> -----Original Message-----
> From: Drew Kidder [mailto:Andrew.Kidder@Tivoli.com]
> Sent: Tuesday, September 26, 2000 12:02 PM
> To: tomcat-user@jakarta.apache.org
> Subject: document cacheing
> 
> 
> Heya all...
> 
> I've written a servlet and have attempted to add some rudimentary
> bandwidth 
> throttling. Basically, I'm sleeping for 2 seconds between writes (this 
> value will change). The basic algorithm is like this:
> 
> while (more stuff to read) {
> 	out.write(buffer and stuff);
> 	if (throttling_on)
> 		Thread.sleep(2000);
> }
> 
> The behavior that I'm getting is that an un-throttled document will 
> download like always (no surprise there), and the "save/open" popup
> appears 
> immediately. A throttled document takes much longer to pop up the 
> "save/open" dialog box in the browser, and yet the file downloads in the 
> same amount of time as the un-throttled download. So it looks to me as if 
> Tomcat or apache or something is caching the document (reading from the 
> servlet output stream), and is then transmitting it totally on it's 
> own.  Is there any way to write the output stream directly to the browser,
> 
> or will it always be cached on the server first?
> 
> ------
> Andrew Kidder
> L3 SW/Support Engineer, IBU
> Tivoli Systems
> 
> 512-436-4544
> akidder@tivoli.com
> http://www.tivoli.com

Mime
View raw message