class HerokuDeflater::CacheControlManager
Constants
- DEFAULT_MAX_AGE
Attributes
app[R]
max_age[R]
Public Class Methods
new(app)
click to toggle source
# File lib/heroku-deflater/cache_control_manager.rb, line 6 def initialize(app) @app = app @max_age = DEFAULT_MAX_AGE end
Public Instance Methods
cache_control_headers()
click to toggle source
# File lib/heroku-deflater/cache_control_manager.rb, line 15 def cache_control_headers if rails_version_5? headers = app.config.public_file_server.headers ||= {} headers['Cache-Control'] ||= "public, max-age=#{max_age}" else headers = app.config.static_cache_control end headers end
setup_max_age(max_age)
click to toggle source
# File lib/heroku-deflater/cache_control_manager.rb, line 11 def setup_max_age(max_age) @max_age = max_age end
Private Instance Methods
rails_version_5?()
click to toggle source
# File lib/heroku-deflater/cache_control_manager.rb, line 27 def rails_version_5? Rails::VERSION::MAJOR >= 5 end