Hi there,
I'm trying to improve the performance of my WebDAV server, and I noticed a problem when downloading big files.
I have an nginx as reverse proxy in front of an Apache, on which SabreDAV runs.
In SabreDAV I have my App_DAV_File class:
public function get()
{
return fopen($this->getInternalPhysicalPath($this->myPath), 'r');
}
This is working fine, but it seems that Apache will send the whole 800 MB file to nginx, and nginx starts to send the file to the client. But it takes a bit (5-10 seconds) until nginx serves the file, and I guess the problem is that the 800 MB have to be read by apache, sent to the nginx, which saves the file to local harddisc. It also adds 800 MB of internal network traffic, from Apache to nginx.
I would like to improve that, and use nginx' feature X-Accel-Redirect. Apache should just send the local file path to nginx, and then nginx serves the file. Then there is no 800 MB internal traffic, and I guess the download starts faster.
http://wiki.nginx.org/X-accel
How can I do this? I cannot set this HTTP-Header in my App_DAV_File class as far as I can see.
And then I have to check if range-Requests still work correctly if I use X-Accel-Redirect…
I'm still running SabreDAV 1.3.4 ;-/ But the same "problem" exists in the current version as far as I can see.
(I'm planning to upgrade to 2.0/2.1, it seems to be pretty stable today, but it's a huge step and much work)
Michael