Module: Rack::MogileFS::Endpoint::Caching

Included in:
Rack::MogileFS::Endpoint
Defined in:
lib/rack/mogilefs/endpoint/caching.rb

Overview

Adds support for expires headers. You can specify a number or a proc that will recieve (path, ext, mime) as arguements. You should return the number of seconds to cache.

Instance Method Summary collapse

Instance Method Details

#headers(file) ⇒ Object



14
15
16
# File 'lib/rack/mogilefs/endpoint/caching.rb', line 14

def headers(file)
  super.merge( cache_control_header(file) )
end

#initializeObject



9
10
11
12
# File 'lib/rack/mogilefs/endpoint/caching.rb', line 9

def initialize(*)
  super
  @options[:expires] ||= false
end