diff options
author | Richard Hulse <richard.hulse@radionz.co.nz> | 2011-08-08 18:02:19 +1200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:22:33 -0700 |
commit | 32da2f864eb9e1f626f25e5d46a38d0c0d214d15 (patch) | |
tree | e3dea98b1952dab0099e5c14a3870d45461205b6 /railties/guides | |
parent | 93ec7bb59a62702051377e9beb43501ccd9d0f2a (diff) | |
download | rails-32da2f864eb9e1f626f25e5d46a38d0c0d214d15.tar.gz rails-32da2f864eb9e1f626f25e5d46a38d0c0d214d15.tar.bz2 rails-32da2f864eb9e1f626f25e5d46a38d0c0d214d15.zip |
[asset pipeline] update to reflect new sendfile header default
X-Sendfile headers are now set to nil and are off by default.
See commit eff7fddeb26eaa346827
Diffstat (limited to 'railties/guides')
-rw-r--r-- | railties/guides/source/asset_pipeline.textile | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/railties/guides/source/asset_pipeline.textile b/railties/guides/source/asset_pipeline.textile index 3a87c90516..3eede31572 100644 --- a/railties/guides/source/asset_pipeline.textile +++ b/railties/guides/source/asset_pipeline.textile @@ -385,16 +385,14 @@ This is a handy option if you have any existing project (pre Rails 3.1) that alr h4. X-Sendfile Headers -The X-Sendfile header is a directive to the server to ignore the response from the application, and instead serve the file specified in the headers. In production Rails (via Sprockets) does not send the asset - just the location and a zero-length response - relying on the web server to do the file serving, which is usually faster. Both Apache and nginx support this option. +The X-Sendfile header is a directive to the server to ignore the response from the application, and instead serve the file specified in the headers. This option is off be default, but can be enabled if your server supports it. When enabled, this passes responsibility for serving the file to the web server, which is faster. -The configuration is available in <tt>config/environments/production.rb</tt>. +Apache and nginx support this option which is enabled in <tt>config/environments/production.rb</tt>. <erb> config.action_dispatch.x_sendfile_header = "X-Sendfile" # Use 'X-Accel-Redirect' for nginx </erb> -You should check that your server or hosting service actually supports this, otherwise comment it out. - WARNING: If you are upgrading an existing application and intend to use this option, take care to paste this configuration option only into +production.rb+ (and not +application.rb+) and any other environment you define with production behavior. h3. How Caching Works |