public
Description: A project to provide a more efficient send_file method for Ruby on Rails’ ActionController by sending files directly via reverse proxy servers. Currently only supports Nginx.
Homepage:
Clone URL: git://github.com/kete/better_send_file.git
name age message
file README Mon Aug 25 21:09:32 -0700 2008 Added deprecation notice. [jstr]
file init.rb Sun Apr 20 15:38:57 -0700 2008 1. Removed scraps from previous testing experim... [jstr]
directory lib/ Tue Aug 19 20:41:49 -0700 2008 Bug fix: The correct file path is now sent in t... [jstr]
file license.txt Sun Apr 20 16:49:10 -0700 2008 Added GPL license [jstr]
directory tests/ Sun Apr 20 15:38:57 -0700 2008 1. Removed scraps from previous testing experim... [jstr]
README
better-send-file
================

Deprecation Notice
==================

This plugin is no longer in use in Kete (http://github.com/kete/kete) and therefore will no longer be maintained by 
Katipo Communications LTD.

Summary
=======

better_send_file is a plugin by James Stradling <http://www.katipo.co.nz> which overrides Rail's 
ActionController::Streaming#send_file method to use a reverse proxy to send files.

This is especially useful when running Mongrels as web-servers as send_file can tie up a mongrel instance for a long 
period of time in some circumstances.

better-send-file functionality
==============================

better_send_file currently supports the following reverse proxies:
  Nginx (X-Accel-Redirect)
  
usage
=====

1.  Configure Nginx to handle the X-Accel-Redirect header, then restart your Nginx server.

  a) Add the following declaration in the server block on the nginx.conf file
  
  location /private/ {
    root /home/user/apps/my_app/;
    internal;
  }
  
  b) Substitute /private for the path inside your application to the files to be served. This is file system relative, 
  not URL relative. For instance, in the example above, /private references the folder at 
  /home/user/apps/my_app/private.
  c) Substitute /home/user/apps/my_app/ for the full path to your applications's root directory.

  NB: The internal declaration is mandatory, but has the side effect that files inside this folder cannot be fetched 
  from outside of your application directly (i.e. through a GET request to the appropriate URL). The file must be 
  actively served from inside the application by sending the X-Accel-Redirect header to the Nginx server.
  
  
2.  Add the better_send_file plugin to your application's vendor/plugins/ directory.
3.  Restart your web-server (e.g. mongrel) instances, and you're good to go. better_send_file override's rails' 
send_file method so you can keep using this as normal.

See the Rails docs at http://api.rubyonrails.org for more info.