Class: Nanoc::Extra::CHiCk::CacheController Deprecated

Inherits:
Object
  • Object
show all
Defined in:
lib/nanoc/extra/chick.rb

Overview

Deprecated.

Use a HTTP library such as Net::HTTP or Curb instead.

Instance Method Summary (collapse)

Constructor Details

- (CacheController) initialize(app, options = {})

Returns a new instance of CacheController



63
64
65
66
# File 'lib/nanoc/extra/chick.rb', line 63

def initialize(app, options = {})
  @app = app
  @options = options
end

Instance Method Details

- (Object) call(env)



68
69
70
71
72
73
74
# File 'lib/nanoc/extra/chick.rb', line 68

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