camping/camping — Issue #46: modify the x-sendfile logic to send appropriate cache headers
Author: igravious
Created: 2011-10-31 10:37:37+00:00
State: open

I know you should only use `Camping` in dev mode and then move on to `Apache` or `Nginx` + `mod_rails` for production but it would still be nice if in de mode that `Camping` was a bit smarter in this area.

See for example this page by the [mod_xsendfile] (https://tn123.org/mod_xsendfile/) guys for Apache where they mention a couple of tricks:

* Sets correct cache headers such as `Etag` and `If-Modified-Since` as if the file was statically served.
* Processes cache headers such as `If-None-Match` or `If-Modified-Since`.

judofyr mentioned this code from Rack: https://github.com/rack/rack/blob/master/lib/rack/file.rb#L56-L64