I have created a patch for ResponseCache. It allows you to configure a Proc object to handle X-Sendfile processing. This is needed for Nginx, for example, because Nginx supports X-Accel-Redirect but not X-Sendfile.
The proc object gets supplied with 4 parameters: request, response, page_cache_dir and cache filename.
The unit test I've included has an implementation which works for Nginx.
I'm using the patch in production but I've applied the patch to Radiant-0.6.4. in 0.6.4, page_cache_path() in response_cache.rb is broken for the root path "/". This is fixed in 0.6.5. I've added a unit test for that as well.
Sample code for environment.rb:
ResponseCache.defaults[:sendfile_proc] = lambda { |request, response, cache_dir, file|
filename = file.slice(File.expand_path(cache_dir).length, file.length)
response.headers.merge!('X-Accel-Redirect' => "/cache#{filename}.data")
}
and your nginx config file:
location /cache {
internal;
root /var/www/apps/example/current/cache/;
}