[web-devel] Content-Length on sendFile

Kazu Yamamoto ( 山本和彦 ) kazu at iij.ad.jp
Wed Jun 15 03:26:29 CEST 2011


> I think the reason we didn't include the header is because, when I
> wrote it, I didn't know of a cross-platform way to get file sizes. Now
> that I know about unix-compat, this seems like a reasonable thing to
> add. Anyone know a reason we *shouldn't* do this?

For high performance web servers, system calls are the bottleneck.
So, Warp or its libraries should avoid unnecessary system calls.

Wai applications HAVE TO call a system call (stat()) to get file
information (for instance, modification time) and can get a file size
at the same time. So, they can add Content-Length: with one system

If Warp or its libraries add Content-Length:, they need to call as
system call again. It gives really bad performance impact.

So, I support the current way of Warp.


More information about the web-devel mailing list