Skip to content

Commit eb337b5

Browse files
committed
keep IP cache in memory rather than on disk
1 parent 96c97c7 commit eb337b5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

config/initializers/rack-attack.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# In config/initializers/rack-attack.rb
22
class Rack::Attack
33

4+
Rack::Attack.cache.store = ActiveSupport::Cache::MemoryStore.new
5+
46
throttle('req/ip', :limit => 300, :period => 5.minutes) do |req|
57
req.ip # unless req.path.starts_with?('/assets')
68
end

0 commit comments

Comments
 (0)