class Rack::Jasmine::CacheControl

Public Class Methods

new(app) click to toggle source
# File lib/rack/jasmine/cache_control.rb, line 5
def initialize(app)
  @app, @content_type = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/rack/jasmine/cache_control.rb, line 9
def call(env)
  status, headers, body = @app.call(env)
  headers = Rack::Utils::HeaderHash.new(headers)
  headers['Cache-Control'] ||= "max-age=0, private, must-revalidate"
  headers['Pragma'] ||= "no-cache"
  [status, headers, body]
end