stefanprodan / WebApiThrottle

ASP.NET Web API rate limiter for IIS and Owin hosting
MIT License
1.28k stars 274 forks source link

How to to throttle regardless of IP address, Client Key or Endpoint? #69

Closed NanditaReshamwala closed 8 years ago

NanditaReshamwala commented 8 years ago

hi,

Our requirement is to limit the number of API calls regardless of it has been originated from the same IP address or different. We also do not want to limit by Client API key or Endpoint. How can it be done.? I tried ThrottlePolicy with global perWeek = 1 and setting all(IpThrottling, EndPointThrottling,ClientThrottling) to false, but it did not help because I beleive Throttling is disabled.

Do you have any suggestion?

stefanprodan commented 8 years ago

You can do this by enabling ClientThrottling. If a the client key is not specified, then all your clients will have the _anon_ key. So you can rate limit all of them under that key. You don't have to target the anon key, all you need to do is enable ClientThrottling and to define global rate limits.