Class: Nanoc::Extra::CHiCk::CacheController Deprecated
- Inherits:
-
Object
- Object
- Nanoc::Extra::CHiCk::CacheController
- Defined in:
- lib/nanoc/extra/chick.rb
Overview
Instance Method Summary (collapse)
-
- (Object) call(env)
-
- (CacheController) initialize(app, options = {})
constructor
A new instance of CacheController.
Constructor Details
- (CacheController) initialize(app, options = {})
Returns a new instance of CacheController
68 69 70 71 |
# File 'lib/nanoc/extra/chick.rb', line 68 def initialize(app, = {}) @app = app @options = end |
Instance Method Details
- (Object) call(env)
73 74 75 76 77 78 79 |
# File 'lib/nanoc/extra/chick.rb', line 73 def call(env) res = @app.call(env) unless res[1].key?('Cache-Control') || res[1].key?('Expires') res[1]['Cache-Control'] = "max-age=#{@options[:max_age]}" end res end |