Class: Adsf::Rack::Caching
- Inherits:
-
Object
- Object
- Adsf::Rack::Caching
- Defined in:
- lib/adsf/rack/caching.rb
Constant Summary collapse
- DEFAULT_HEADERS =
{ 'cache-control' => 'max-age=0, stale-if-error=0', }.freeze
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Caching
constructor
A new instance of Caching.
Constructor Details
#initialize(app) ⇒ Caching
9 10 11 |
# File 'lib/adsf/rack/caching.rb', line 9 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/adsf/rack/caching.rb', line 13 def call(env) status, headers, body = *@app.call(env) headers = DEFAULT_HEADERS.merge(headers) [status, headers, body] end |