def cache_control(*values)
      if values.last.kind_of?(Hash)
        hash = values.pop
        hash.reject! { |k, v| v == false }
        hash.reject! { |k, v| values << k if v == true }
      else
        hash = {}
      end

      values.map! { |value| value.to_s.tr('_','-') }
      hash.each do |key, value|
        key = key.to_s.tr('_', '-')
        value = value.to_i if ['max-age', 's-maxage'].include? key
        values << "#{key}=#{value}"
      end

      response['Cache-Control'] = values.join(', ') if values.any?
    end
def cache_control(*values)
      if values.last.kind_of?(Hash)
        hash = values.pop
        hash.reject! { |k, v| v == false }
        hash.reject! { |k, v| values << k if v == true }
      else
        hash = {}
      end

      values.map! { |value| value.to_s.tr('_','-') }
      hash.each do |key, value|
        key = key.to_s.tr('_', '-')
        value = value.to_i if ['max-age', 's-maxage'].include? key
        values << "#{key}=#{value}"
      end

      response['Cache-Control'] = values.join(', ') if values.any?
    end
Specify response freshness policy for HTTP caches (Cache-Control header).
 Any number of non-value directives (:public, :private, :no_cache,
 :no_store, :must_revalidate, :proxy_revalidate) may be passed along with
 a Hash of value directives (:max_age, :s_maxage).

   cache_control :public, :must_revalidate, :max_age => 60
   => Cache-Control: public, must-revalidate, max-age=60

 See RFC 2616 / 14.9 for more on standard cache control directives:
 http://tools.ietf.org/html/rfc2616#section-14.9.1