2009年7月19日 星期日

X-Sendfile

mod_xsendfile
Reference : Advanced Rails p121

The X-Sendfile protocol is a very simple standard, first introduced in the Lighttpd
web server, which directs the web server to send a file from the filesystem to the client
rather than a response generated by the application server.

X-Sendfile uses the X-Sendfile HTTPheader pointing to the server’s path to the file
to send, in conjunction with the other standard HTTPheaders. A typical response
using X-Sendfile would look something like this:


From Rails, you can set the response headers by modifying the response.headers
hash:

沒有留言: