MantisBT: master b50a52a4

Author Committer Branch Timestamp Parent
dhx dhx master 2010-01-05 03:36 master 45771c63
Affected Issues  0011291: Add support for Lighttpd's X-Sendfile method for sending attachments stored locally
Changeset

Issue 0011291: Add X-Sendfile support for high performance file downloads

X-Sendfile is a header that is added to the output response from PHP
that points to a local file on the disk. Upon receiving the header once
the PHP script has terminated, the web server proceeds to replace all
content in the HTTP response with the contents of the file served up
locally from the disk. Headers set in the PHP script are usually kept
in-tact (depending on the web server implementation as to what gets
changed).

This technique is meant to improve performance as it now becomes
possible for the web server to use highly efficient file serving
functions to serve up the static content. For example, a web server
could use a zero-copy splice() call on Linux platforms to prevent
unnecessary buffering, drastically improving performance.

Servers that support X-Sendfile (or equivalent, as determined by the
$g_file_download_xsendfile_header_name option) include:

  • Lighttpd
  • Cherokee
  • Apache (with mod_xsendfile)
  • nginx
mod - config_defaults_inc.php Diff File
mod - docbook/adminguide/en/configuration.sgml Diff File
mod - file_download.php Diff File