method

expires_in

expires_in(seconds, options = {})
protected

Sets a HTTP 1.1 Cache-Control header. Defaults to issuing a "private" instruction, so that intermediate caches shouldn’t cache the response.

Examples:

  expires_in 20.minutes
  expires_in 3.hours, :private => false
  expires in 3.hours, 'max-stale' => 5.hours, :private => nil, :public => true

This method will overwrite an existing Cache-Control header. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities.

1Note

'max-stale' should be sent by client, not by server

kuboon ยท Dec 12, 2014

3rd example is a trap.