def expires(amount, *values)
      values << {} unless values.last.kind_of?(Hash)

      if amount.is_a? Integer
        time    = Time.now + amount.to_i
        max_age = amount
      else
        time    = time_for amount
        max_age = time - Time.now
      end

      values.last.merge!(:max_age => max_age)
      cache_control(*values)

      response['Expires'] = time.httpdate
    end
def expires(amount, *values)
      values << {} unless values.last.kind_of?(Hash)

      if amount.is_a? Integer
        time    = Time.now + amount.to_i
        max_age = amount
      else
        time    = time_for amount
        max_age = time - Time.now
      end

      values.last.merge!(:max_age => max_age)
      cache_control(*values)

      response['Expires'] = time.httpdate
    end
Set the Expires header and Cache-Control/max-age directive. Amount
 can be an integer number of seconds in the future or a Time object
 indicating when the response should be considered "stale". The remaining
 "values" arguments are passed to the #cache_control helper:

   expires 500, :public, :must_revalidate
   => Cache-Control: public, must-revalidate, max-age=60
   => Expires: Mon, 08 Jun 2009 08:50:17 GMT