Sha256: 8b2df731b61f85affbdb6f64157a0a29e45acef317ee19b120c8cb0ce92d3ec6
Contents?: true
Size: 539 Bytes
Versions: 19
Compression:
Stored size: 539 Bytes
Contents
# This file is part of the "Utopia Framework" project, and is licensed under the GNU AGPLv3. # Copyright 2010 Samuel Williams. All rights reserved. # See <utopia.rb> for licensing details. class Rack::Response def do_not_cache! self["Cache-Control"] = "no-cache, must-revalidate" self["Expires"] = Time.now.httpdate end 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 end
Version data entries
19 entries across 19 versions & 1 rubygems