Class: Waw::NoCache

Inherits:
Controller show all
Defined in:
lib/waw/controllers/no_cache.rb

Constant Summary collapse

NO_CACHE_HEADERS =

What is sent to the headers

{'Cache-control' => "no-store, no-cache, must-revalidate", 
'Pragma'        => "no-cache"}

Constants included from EnvironmentUtils

EnvironmentUtils::DEPRECATED_MSG

Instance Method Summary collapse

Methods inherited from Controller

#execute

Methods included from Rack::Delegator

#_visit, #delegate, #find_rack_app, #find_url_of, #has_delegate?, #is_delegate?, #visit

Methods included from EnvironmentUtils

#env, #session_get, #session_has_key?, #session_set, #session_unset

Methods included from ScopeUtils

#config, #find_kernel_context, #logger, #params, #rack_env, #real_session, #request, #resources, #response, #root_folder, #session

Constructor Details

#initialize(app) ⇒ NoCache

Creates a application instance



10
11
12
# File 'lib/waw/controllers/no_cache.rb', line 10

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object

Manage calls



15
16
17
18
19
# File 'lib/waw/controllers/no_cache.rb', line 15

def call(env)
  status, headers, body = @app.call(env)
  headers = NO_CACHE_HEADERS.merge('Expires' => Time.now.rfc2822).merge(headers)
  [status, headers, body]
end