I'm personally quite concerned about trying to figure out the content-length in any Rack middleware. It's expensive to do in pure-ruby, and a later middleware can mess with the size anyway and be forced to recalculate. I think the appropriate place for this calculation is in the actual server that sends the data to the client, where it can be done once and in C. -- Yehuda On Thu, Aug 13, 2009 at 9:18 AM, Jeremy Kemper wrote: > > On Thu, Aug 13, 2009 at 5:14 AM, Christian > Neukirchen wrote: > > > > Jeremy Kemper writes: > > > >> CommonLogger's concern > >> is logging the request, not calculating content length edge cases > > > > The CLF includes the real response size, though. It should be correct > > if you want to do traffic analysis with the existing tools. > > There is no standard "real" size. Most log the size of the entity body > as represented by Content-Length. Some include HTTP header size. Few > actually record the number of bytes sent to the client (mog_logio for > apache does). > > jeremy > -- Yehuda Katz Developer | Engine Yard (ph) 718.877.1325