README in viximo-rack-throttle-0.4.0 vs README in viximo-rack-throttle-0.5.0
- old
+ new
@@ -137,37 +137,23 @@
name, you need only subclass a throttling strategy implementation and
override the `#client_identifier` method.
HTTP Response Codes and Headers
-------------------------------
+### 429 Too Many Requests
+In the past various status codes has been used to indicate over-use.
-### 403 Forbidden (Rate Limit Exceeded)
+In 2012, the IETF standardized on a new response status 429 (Too Many Requests)
+[RFC6585].
When a client exceeds their rate limit, `Rack::Throttle` by default returns
-a "403 Forbidden" response with an associated "Rate Limit Exceeded" message
+a 429 (Too Many Requests) header with an associated "Rate Limit Exceeded" message
in the response body.
-An HTTP 403 response means that the server understood the request, but is
-refusing to respond to it and an accompanying message will explain why.
-This indicates an error on the client's part in exceeding the rate limits
-outlined in the acceptable use policy for the site, service, or API.
+The status code can be overridden by passing in `:code => 403` option when
+constructing a `Rack::Throttle::Limiter` instance.
-### 503 Service Unavailable (Rate Limit Exceeded)
-
-However, there exists a widespread practice of instead returning a "503
-Service Unavailable" response when a client exceeds the set rate limits.
-This is technically dubious because it indicates an error on the server's
-part, which is certainly not the case with rate limiting - it was the client
-that committed the oops, not the server.
-
-An HTTP 503 response would be correct in situations where the server was
-genuinely overloaded and couldn't handle more requests, but for rate
-limiting an HTTP 403 response is more appropriate. Nonetheless, if you think
-otherwise, `Rack::Throttle` does allow you to override the returned HTTP
-status code by passing in a `:code => 503` option when constructing a
-`Rack::Throttle::Limiter` instance.
-
Documentation
-------------
<http://datagraph.rubyforge.org/rack-throttle/>
@@ -219,5 +205,6 @@
[memcache-client]: http://rubygems.org/gems/memcache-client
[memcache]: http://rubygems.org/gems/memcache
[redis]: http://rubygems.org/gems/redis
[Heroku]: http://heroku.com/
[Heroku memcache]: http://docs.heroku.com/memcache
+[RFC6585]: http://tools.ietf.org/html/rfc6585