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.
There is no standard "real" size. Most log the size of the entity body
On Thu, Aug 13, 2009 at 5:14 AM, Christian
Neukirchen<chneukirchen@gmail.com> wrote:
>
> Jeremy Kemper <jeremy@bitsweat.net> 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.
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