Parent

Methods

Class/Module Index [+]

Quicksearch

Nanoc::Extra::CHiCk::CacheController

@deprecated Use a HTTP library such as

[Net::HTTP](http://ruby-doc.org/stdlib/libdoc/net/http/rdoc/) or
[Curb](http://curb.rubyforge.org/) instead.

Public Class Methods

new(app, options={}) click to toggle source
# File lib/nanoc/extra/chick.rb, line 66
def initialize(app, options={})
  @app = app
  @options = options
end

Public Instance Methods

call(env) click to toggle source
# File lib/nanoc/extra/chick.rb, line 71
def call(env)
  res = @app.call(env)
  unless res[1].has_key?('Cache-Control') || res[1].has_key?('Expires')
    res[1]['Cache-Control'] = "max-age=#{@options[:max_age]}"
  end
  res
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.