Class: Rack::Response
Instance Method Summary collapse
Instance Method Details
#cache!(duration = 3600) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/utopia/extensions/rack.rb', line 24 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
31 32 33 |
# File 'lib/utopia/extensions/rack.rb', line 31 def content_type!(value) self["Content-Type"] = value.to_s end |