[web-devel] Content-Length on sendFile

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


Hello Greg,

>> 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
>> call.
> 
> There are 2 basic kinds of WAI apps- those for serving files that might change
> (a file server), and those that know exactly what files exist in advance (a
> web application). In the case of a web application, we can get all this
> information just once at compile time. For a file server, we could allow a
> configuration parameter for whether or not to do the system call. Of course,
> it is possible to mix these 2 use cases in one application, but that can be
> handled with multiple instances of wai-app-static.

Yes, I know. The former uses ResponseFile and the latter typically
uses ResponseBuilder/ResponseEnumerator. I discussed in the context of
ResponseFile which uses sendfile.

Sorry but I don't understand what you try to explain here.

--Kazu



More information about the web-devel mailing list