Re: How to make FASTCGI deliver an external file

"Ravi Menon" <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
> I think it would be a function from FastCGI API. In it's turn, FastCGI
> would call there inside the http server a specific function from this
> http server API.
>
> Isnt it like that ?
>
[ hopefully I got your doubts well understood]

I can only speak in terms of Linux/FreeBSD env. (but quite likely it
is similar in Windows too.).

It will be a minor extra 'ipc hop' (via that unix socket) from the
fast-cgi server back to http server to give a notice to say, "hey go
serve this file".

Since the original request came to the fast-cgi server in the first
place (where some additional custom authorizations were performed if I
recall your example correctly), then why not serve the file directly
esp. if there are efficient zero-copy optimisation syscalls like
sendfile() are available. This approach will be marginally more
efficient as it saves that extra   call back to the http server (ipc
cost, context switches and so on...).

But I can see some value in re-using exsisting http server capability
in serving files as you suggest (it does its own default
authorizations etc.. which you may want to also apply - i.e. basic
unix permissions and so on). Incidentally apache 2x does use
sendfile() in  Linux and FreeBSD env. (if my memory serves me right).

Engineering...it is all about trade-offs :-)

Ravi
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.