Rails action_cache plugin updated to use x-sendfile

November 4, 2006 Link to post  Permalink

I’ve just checked in an update to my Rails action_cache plugin. The main change is that now, under the right conditions, the plugin will serve up the cache content using the X-Sendfile header supported by lighttpd and other web servers.

To use the X-Sendfile functionality, three things need to be configured:

  1. X-Sendfile support enabled in the web server
  2. The environment variable ENABLE_X_SENDFILE must be set
  3. The Rails fragment cache store must be set to use the FileStore class

The internal format of the cache has been changed to support the X-Sendfile code. Now the cache entry is stored in two fragments, one for meta-data and headers, the other for the response body.

The README has more info on how to set this up.