[web-devel] Content-Length on sendFile
mxcantor at gmail.com
Wed Jun 15 03:58:31 CEST 2011
I think thats a very good point. Based on this, I'd agree that perhaps we shouldn't change sendFile. But, I still support a note in the haddocks and possibly adding a second function as in my previous post.
On Jun 15, 2011, at 9:26 AM, Kazu Yamamoto (山本和彦) wrote:
>> 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.
> web-devel mailing list
> web-devel at haskell.org
More information about the web-devel