<commit_before>#Sinatra Extension: XSendFile

`sinatra-xsendfile` extension provides `x_send_file` helper method for sending files faster

##XSendFile
* in [lighttpd](http://redmine.lighttpd.net/projects/1/wiki/X-LIGHTTPD-send-file);
* in [apache](http://tn123.ath.cx/mod_xsendfile/);
* in [nginx](http://wiki.nginx.org/NginxXSendfile).


##Example
    require 'rubygems'
    require 'sinatra'
    gem 'sinatra-xsendfile'
    require 'sinatra/x_send_file'

    configure :production do
      Sinatra::XSendFile.replace_send_file! #replaces sinatra's send_file with x_send_file
      set :xsf_header, 'X-Accel-Redirect' #setting default(X-SendFile) header (nginx)
    end

    get '/' do
      x_send_file(__FILE__)
    end

    get '/nginx' do
      x_send_file(__FILE__, :header => 'X-LIGHTTPD-send-file')
    end

    get '/sendfile' do
      send_file(__FILE__) #will work as x_send_file in production
    end
<commit_msg>updated example<commit_after>#Sinatra Extension: XSendFile

`sinatra-xsendfile` extension provides `x_send_file` helper method for sending files faster

##XSendFile
* in [lighttpd](http://redmine.lighttpd.net/projects/1/wiki/X-LIGHTTPD-send-file);
* in [apache](http://tn123.ath.cx/mod_xsendfile/);
* in [nginx](http://wiki.nginx.org/NginxXSendfile).


##Example
    require 'rubygems'
    require 'sinatra'
    require 'sinatra/x_send_file'

    configure :production do
      Sinatra::XSendFile.replace_send_file! #replaces sinatra's send_file with x_send_file
      set :xsf_header, 'X-Accel-Redirect' #setting default(X-SendFile) header (nginx)
    end

    get '/' do
      x_send_file(__FILE__)
    end

    get '/nginx' do
      x_send_file(__FILE__, :header => 'X-LIGHTTPD-send-file')
    end

    get '/sendfile' do
      send_file(__FILE__) #will work as x_send_file in production
    end

{'fraction_non_alphanumeric': 0.12006578947368421, 'fraction_numerical': 0.0043859649122807015, 'mean_word_length': 3.74025974025974, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1580944', 'n_tokens_mistral': 665, 'n_tokens_neox': 642, 'n_words': 135}