Skip to content

Commit 27b134c

Browse files
committed
Added Rack-Cache
1 parent 90cf929 commit 27b134c

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,5 +178,6 @@ group :production do
178178
gem 'puma'
179179
gem 'puma_worker_killer'
180180
gem 'rack-attack'
181+
gem 'rack-cache'
181182
gem 'rails_12factor'
182183
end

Gemfile.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,7 @@ DEPENDENCIES
685685
querystring
686686
quiet_assets
687687
rack-attack
688+
rack-cache
688689
rails (~> 3.2)
689690
rails-erd
690691
rails_12factor

config/environments/production.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
config.assets.digest = true
2929
config.static_cache_control = 'public, max-age=31536000'
3030
config.host = ENV['HOST_DOMAIN']
31+
config.action_dispatch.rack_cache = true
32+
client = Dalli::Client.new(ENV['MEMCACHIER_SERVERS'], value_max_bytes: 10_485_760)
33+
config.action_dispatch.rack_cache = { metastore: client, entitystore: client }
34+
3135
config.middleware.use('Rack::Deflater')
3236
config.middleware.use('Rack::Attack')
3337
end

0 commit comments

Comments
 (0)