diff --git a/Gemfile b/Gemfile index d2f6c960c..2fb914d00 100644 --- a/Gemfile +++ b/Gemfile @@ -14,6 +14,7 @@ gem 'jbuilder', '~> 2.0' gem 'inline_svg' gem 'redis', '~> 3.0' +gem 'dalli' gem 'newrelic_rpm' diff --git a/Gemfile.lock b/Gemfile.lock index b8017b8fc..b3309a964 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -82,6 +82,7 @@ GEM execjs coffee-script-source (1.10.0) concurrent-ruby (1.0.2) + dalli (2.7.6) database_cleaner (1.5.3) debug_inspector (0.0.2) descendants_tracker (0.0.4) @@ -346,6 +347,7 @@ DEPENDENCIES byebug capybara coffee-rails (~> 4.1.0) + dalli database_cleaner devise (~> 4.1) devise-i18n diff --git a/config/environments/production.rb b/config/environments/production.rb index 0198fa047..ad46e6042 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -52,7 +52,15 @@ config.log_tags = [ :request_id ] # Use a different cache store in production. - # config.cache_store = :mem_cache_store + config.cache_store = :dalli_store, + (ENV["MEMCACHIER_SERVERS"] || "").split(","), + {:username => ENV["MEMCACHIER_USERNAME"], + :password => ENV["MEMCACHIER_PASSWORD"], + :failover => true, + :socket_timeout => 1.5, + :socket_failure_delay => 0.2, + :down_retry_delay => 60 + } # Use a real queuing backend for Active Job (and separate queues per environment) # config.active_job.queue_adapter = :resque