Browse files

Added a section on unique HTTP client identifiers.

  • Loading branch information...
bendiken committed Mar 21, 2010
1 parent ef297f1 commit 3eb22ccb30dadfa4f7c8e7196a294fbbc2748546
Showing with 12 additions and 0 deletions.
  1. +12 −0
@@ -46,6 +46,18 @@ Examples
require 'redis'
use Rack::Throttle::Interval, :cache =>, :key_prefix => :throttle
+HTTP Client Identification
+The rate-limiting counters stored and maintained by `Rack::Throttle` are
+keyed to unique HTTP clients.
+By default, HTTP clients are uniquely identified by their IP address as
+returned by `Rack::Request#ip`. If you wish to instead use a more granular,
+application-specific identifier such as a session key or a user account
+name, just subclass `Rack::Throttle::Interval` and override the
+`#client_identifier` method.
HTTP Response Codes and Headers

0 comments on commit 3eb22cc

Please sign in to comment.