sendfile in PHP

    Date: 09/26/05 (PHP Community)    Keywords: php, web, apache

    Howdy folks.

    The Apache webserver has the ability to use the sendfile() syscall to efficiently send static files. This feature copies from the file to the socket at the kernel level and is thus very efficient. I'm currently writing an app in PHP which will need to efficiently send a large file to the user without clients being able to request the file directly.

    My question is whether there's any way to get at this from PHP land. I see the virtual() function which causes Apache to perform a subrequest, but I'm hoping there's a way to do it without incurring the subrequest overhead. I've also seen PHP's readfile() function and its friends, but I suspect (please correct me if I'm wrong) that the copying between file and socket will then happen in PHP land.

    Alternative approaches are welcome too. :)

    Source: http://www.livejournal.com/community/php/347342.html

« Introduction and question || Function With Possible Race... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home