Module: Sinicum::Controllers::CacheAware

Included in:
Sinicum::ControllerBase
Defined in:
app/controllers/sinicum/controllers/cache_aware.rb

Constant Summary collapse

DEFAULT_CACHE_EXPIRATION_TIME =
10.minutes
TIMESTAMP_ASSET_EXPIRATION_TIME =
30.days

Instance Method Summary collapse

Instance Method Details

#client_cache_controlObject

Sets the HTTP cache parameters. By default, an expiration time of 10 minutes and a public cache is used when Rails.env is production



9
10
11
12
13
# File 'app/controllers/sinicum/controllers/cache_aware.rb', line 9

def client_cache_control
  if Rails.application.config.action_controller.perform_caching
    expires_in(DEFAULT_CACHE_EXPIRATION_TIME, public: true)
  end
end