diff --git a/README.md b/README.md index cf0d52b..bc6520a 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ You can subscribe to 'rack.attack' events and log it, graph it, etc: ## Performance -The overhead of running Rack::Attack is typically neglible (a few milliseconds per request), +The overhead of running Rack::Attack is typically negligible (a few milliseconds per request), but it depends on how many checks you've configured, and how long they take. Throttles usually require a network roundtrip to your cache server(s), so try to keep the number of throttle checks per request low. diff --git a/lib/rack/attack/cache.rb b/lib/rack/attack/cache.rb index e5d2bfb..68df476 100644 --- a/lib/rack/attack/cache.rb +++ b/lib/rack/attack/cache.rb @@ -12,7 +12,7 @@ module Rack attr_reader :store def store=(store) # RedisStore#increment needs different behavior, so detect that - # (method has an arity of 2; must call #expire seperately + # (method has an arity of 2; must call #expire separately if defined?(::ActiveSupport::Cache::RedisStore) && store.is_a?(::ActiveSupport::Cache::RedisStore) # ActiveSupport::Cache::RedisStore doesn't expose any way to set an expiry, # so use the raw Redis::Store instead