Module: SinatraHelpers::Cache

Defined in:
lib/sinatra_helpers/cache.rb

Instance Method Summary collapse

Instance Method Details

#cache_for(time_in_secs) ⇒ Object



6
7
8
9
10
# File 'lib/sinatra_helpers/cache.rb', line 6

def cache_for(time_in_secs)
  if production?
    headers['Cache-Control'] = "public, max-age=#{time_in_secs}"
  end
end