Class: Rack::Response
Instance Method Summary collapse
Instance Method Details
#cache!(duration = 3600) ⇒ Object
42 43 44 45 46 47 |
# File 'lib/utopia/extensions/rack.rb', line 42 def cache!(duration = 3600) unless (self["Cache-Control"] || "").match(/no-cache/) self["Cache-Control"] = "public, max-age=#{duration}" self["Expires"] = (Time.now + duration).httpdate end end |
#content_type!(value) ⇒ Object
49 50 51 |
# File 'lib/utopia/extensions/rack.rb', line 49 def content_type!(value) self["Content-Type"] = value.to_s end |