From 32da2f864eb9e1f626f25e5d46a38d0c0d214d15 Mon Sep 17 00:00:00 2001 From: Richard Hulse Date: Mon, 8 Aug 2011 18:02:19 +1200 Subject: [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 --- railties/guides/source/asset_pipeline.textile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'railties/guides/source') 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 config/environments/production.rb. +Apache and nginx support this option which is enabled in config/environments/production.rb. config.action_dispatch.x_sendfile_header = "X-Sendfile" # Use 'X-Accel-Redirect' for nginx -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 -- cgit v1.2.3