Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit ee9f234

Browse files
committed
Update README.md
1 parent 46c1ef6 commit ee9f234

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public static class WebApiConfig
3333
###Endpoint throttling based on IP
3434

3535
If from the same IP, in same second, you'll make two calls to <code>api/values</code> the last call will get blocked.
36+
But if in the same second you'll call <code>api/values/1</code> too, the request will get throw because it's a different route.
3637

3738
``` cs
3839
config.MessageHandlers.Add(new ThrottlingHandler()
@@ -48,7 +49,8 @@ config.MessageHandlers.Add(new ThrottlingHandler()
4849

4950
###Endpoint throttling based on IP and Client Key
5051

51-
If a client (identified by an unique API key) from the same IP, in same second, makes two calls to <code>api/values</code>, then the last call will get blocked.
52+
If a client (identified by an unique API key) from the same IP, in same second, makes two calls to <code>api/values</code>, then the last call will get blocked.
53+
If you want to apply limits to clients regarding of their IPs then you should set IpThrottling to false.
5254

5355
``` cs
5456
config.MessageHandlers.Add(new ThrottlingHandler()
@@ -65,7 +67,7 @@ config.MessageHandlers.Add(new ThrottlingHandler()
6567

6668
###IP and/or Client Key White-listing
6769

68-
If requests are initiated from an white-listed IP or Client, then the throttling policy will not be applied and the requests will not be stored.
70+
If requests are initiated from an white-listed IP or Client, then the throttling policy will not be applied and the requests will not get stored.
6971

7072
``` cs
7173
config.MessageHandlers.Add(new ThrottlingHandler()
@@ -84,7 +86,7 @@ config.MessageHandlers.Add(new ThrottlingHandler()
8486

8587
###IP and/or Client Key custom rate limits
8688

87-
You can define custom limits for known IPs or Client keys, these limits will override the default ones. Be aware that a custom limit will work only if you have defined a global counterpart.
89+
You can define custom limits for known IPs or Client Keys, these limits will override the default ones. Be aware that a custom limit will work only if you have defined a global counterpart.
8890

8991
``` cs
9092
config.MessageHandlers.Add(new ThrottlingHandler()
@@ -102,7 +104,7 @@ config.MessageHandlers.Add(new ThrottlingHandler()
102104
ClientRules = new Dictionary<string, RateLimits>
103105
{
104106
{ "api-client-key-1", new RateLimits { PerMinute = 40, PerHour = 400 } },
105-
{ "api-client-key-9", new RateLimits { PerDay = 5000 } }
107+
{ "api-client-key-9", new RateLimits { PerDay = 2000 } }
106108
}
107109
},
108110
Repository = new CacheRepository()

0 commit comments

Comments
 (0)